If any of the commands RUNreturns a non-zero code, the assembly will fail.
FROM fedora
RUN false
Docker, , false. false - linux, , . , Dockerfile, .
$ docker build .
Uploading context 12.29 kB
Uploading context
Step 0 : FROM fedora
---> 58394af37342
Step 1 : RUN false
---> Running in a5b9a4b37e25
2014/04/22 09:41:19 The command [/bin/sh -c false] returned a non-zero code: 1
, ( , , wget), . , . , , , , , .
FROM fedora
RUN echo ThisIsATest > echo.txt
RUN sha1sum echo.txt > sha1sums.txt
RUN sha1sum -c sha1sums.txt
RUN echo ThisShouldFail > echo.txt
RUN sha1sum -c sha1sums.txt
...
$ docker build -no-cache .
Warning: '-no-cache' is deprecated, it will be removed soon. See usage.
Uploading context 12.8 kB
Uploading context
Step 0 : FROM fedora
Step 1 : RUN echo ThisIsATest > echo.txt
Step 2 : RUN sha1sum echo.txt > sha1sums.txt
Step 3 : RUN sha1sum -c sha1sums.txt
echo.txt: OK
Step 4 : RUN echo ThisShouldFail > echo.txt
Step 5 : RUN sha1sum -c sha1sums.txt
echo.txt: FAILED
WARNING: 1 computed checksum did NOT match
2014/04/22 10:29:07 The command [/bin/sh -c sha1sum -c sha1sums.txt] returned a non-zero code: 1