[CRIU] [PATCH 2/2] Dockerfiles: don't ignore make failures
Kir Kolyshkin
kir at openvz.org
Wed Mar 29 13:15:58 PDT 2017
Commit 299e4b4 ("travis: enable ccache for docker/qemu builds") combined
multiple RUN statements in Dockerfiles into a single one, which is good
for performance (as there is an intermediate cache created after each
statement). Unfortunately, it partially did so by combining statements
with use of semicolons, meaning we are ignoring non-zero exit codes.
As a result, failure from make are ignored and Travis builds are all
green.
To fix, replace all occurences of semicolon with &&.
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
scripts/build/Dockerfile.alpine | 4 ++--
scripts/build/Dockerfile.tmpl | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/scripts/build/Dockerfile.alpine b/scripts/build/Dockerfile.alpine
index 26c39ac..1c46849 100644
--- a/scripts/build/Dockerfile.alpine
+++ b/scripts/build/Dockerfile.alpine
@@ -20,8 +20,8 @@ RUN apk update && apk add \
COPY . /criu
WORKDIR /criu
ENV CC="ccache $CC" CCACHE_DIR=/tmp/.ccache CCACHE_NOCOMPRESS=1 $ENV1=yes
-RUN mv .ccache /tmp; make mrproper; ccache -s; \
- date; make -j $(nproc) CC="$CC"; date
+RUN mv .ccache /tmp && make mrproper && ccache -s && \
+ date && make -j $(nproc) CC="$CC" && date
# Run a test
RUN apk add py-yaml \
diff --git a/scripts/build/Dockerfile.tmpl b/scripts/build/Dockerfile.tmpl
index 7987b01..c562af3 100644
--- a/scripts/build/Dockerfile.tmpl
+++ b/scripts/build/Dockerfile.tmpl
@@ -25,18 +25,18 @@ COPY . /criu
WORKDIR /criu
ENV CC="ccache $CC" CCACHE_DIR=/tmp/.ccache CCACHE_NOCOMPRESS=1 $ENV1=yes
-RUN mv .ccache /tmp && make mrproper; ccache -s; \
- date; \
+RUN mv .ccache /tmp && make mrproper && ccache -s && \
+ date && \
# Check single object build
- make -j $(nproc) CC="$CC" criu/parasite-syscall.o; \
+ make -j $(nproc) CC="$CC" criu/parasite-syscall.o && \
# Compile criu
- make -j $(nproc) CC="$CC"; \
- date; \
+ make -j $(nproc) CC="$CC" && \
+ date && \
# Check that "make mrproper" works
make mrproper && ! git clean -ndx --exclude=scripts/build \
--exclude=.config --exclude=test | grep .
# Compile tests
-RUN date; make -j $(nproc) CC="$CC" -C test/zdtm; date
+RUN date && make -j $(nproc) CC="$CC" -C test/zdtm && date
#RUN make test/compel/handle_binary && ./test/compel/handle_binary
--
2.9.3
More information about the CRIU
mailing list