Every instruction we set in the Dockerfile is going to be built as a separate, temporary image for the other instruction to build itself on top of the previous instruction.
There is a Dockerfile in the repo at /bootcamp/ch
apter06/debu
g
:
FROM alpine RUN ls -lha /home RUN ls -lha /vars CMD echo Hello world
Building the image using the following command:
docker image build
Gives you the following output:
So, there is an error in our Docker file. You may notice there is a line in the output which says --->5f828f86eaa4
this is actually an image file which was built following the successful execution of the RUN ls -lha /
home
line.
This means that we can launch a container using this image:
docker container run -it --name=debug 5f828f86eaa4 /bin/sh
We can then debug our application, which in this case is simple:
Debugging is a process of analyzing what's going on and it's different...