[CRIU] [PATCH 2/4] Dockerfile: do make mrproper before build
Kir Kolyshkin
kir at openvz.org
Tue Oct 25 21:46:38 PDT 2016
I just spent some considerable time trying to figure out the source
of errors like this:
make -C scripts/build ppc64
...
DEP images/autofs.pb-c.d
In file included from images/autofs.pb-c.c:9:0:
images/autofs.pb-c.h:7:35: fatal error: protobuf-c/protobuf-c.h:
No such file or directory
#include <protobuf-c/protobuf-c.h>
^
compilation terminated.
It appears that we copy the complete tree to a docker container, and it
is not cleaned properly before the build. In particular, images/*.pb-c.{c,h}
are not removed/rebuilt. The problem is not noticeable until version of
protobuf-c differs between the host and container, and they use different
include paths (/usr/include/google/protobuf-c/ vs /usr/include/protobuf-c).
As I don't want anyone else to spend so much time figuring this out,
here is the patch.
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
scripts/build/Dockerfile.alpine | 2 +-
scripts/build/Dockerfile.tmpl | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/build/Dockerfile.alpine b/scripts/build/Dockerfile.alpine
index ac2c4d3..ad356bc 100644
--- a/scripts/build/Dockerfile.alpine
+++ b/scripts/build/Dockerfile.alpine
@@ -12,4 +12,4 @@ RUN apk update && apk add \
pkgconfig
COPY . /criu
WORKDIR /criu
-RUN make clean && make -j $(nproc)
+RUN make mrproper && make -j $(nproc)
diff --git a/scripts/build/Dockerfile.tmpl b/scripts/build/Dockerfile.tmpl
index 2538286..92518aa 100644
--- a/scripts/build/Dockerfile.tmpl
+++ b/scripts/build/Dockerfile.tmpl
@@ -21,7 +21,7 @@ RUN apt-get install -y \
COPY . /criu
WORKDIR /criu
-RUN make clean
+RUN make mrproper
RUN make -j $(nproc) criu/parasite-syscall.o
RUN make -j $(nproc)
RUN make mrproper
--
2.7.4
More information about the CRIU
mailing list