github.com/mgoltzsche/ctnr@v0.7.1-alpha/image/builder/dockerfile/testfiles/60-multistage.expected (about) 1 FROM alpine:3.7 2 3 FROM alpine:3.7 4 WORKDIR /etc 5 RUN "/bin/sh" "-c" "printf '#!/bin/sh\\necho hello from script\\n' > script.sh && chmod 744 script.sh" 6 7 FROM alpine:3.7 8 9 FROM alpine:3.7 10 COPY image="stage1-image" "etc/script.sh" "script-copy.sh" 0:0 11 ENV "BASEVAR"="baseenvval" 12 RUN "BASEARG"="baseargval" "/bin/sh" "-c" "[ \"$(pwd)\" = / ] || (\"echo WORKDIR has been inherited from previous stage: ($(pwd))\"; false)" 13 14 FROM scratch 15 COPY image="stage2-image" "/bin/busybox" "/bin/" 0:0 16 COPY image="stage2-image" "/lib/*musl*" "/lib/" 0:0 17 ENTRYPOINT "/bin/busybox" 18 WORKDIR /bin 19 COPY image="stage3-image" "script-copy.sh" "script-copy-copy.sh" 0:0 20 21 RUN "/bin/busybox" "sh" "-c" "[ ! -d /var ] || (ls -la /; false)" 22 RUN "/bin/busybox" "sh" "/bin/script-copy-copy.sh" 23 24 RUN "/bin/busybox" "sh" "-c" "[ ! \"$BASEVAR\" ] || (echo BASEVAR should not be set but is: \"$BASEVAR\"; false)" 25 RUN "/bin/busybox" "sh" "-c" "[ ! \"$BASEARG\" ] || (echo BASEARG should not be set but is: \"$BASEARG\"; false)" 26 27 FROM stage1-image 28 RUN "/bin/sh" "-c" "[ -f /etc/script.sh ] || (echo not inherited from base; false)"