How do you tell Docker to stop executing a Dockefile when one of its RUN commands returns an error code?
I have a Dockerfile like:
FROM ubuntu:18.04
RUN apt install -yq `cat requirements.txt | tr "\\n" " "`
RUN ./some_other_setup.sh
RUN ./my_tests.sh
and occasionally the apt install
will fail if there's a brief network outage. However, the Docker will continue executing the other RUN commands, even though they too will fail because they depend on the apt install
succeeding.