Just highlight the answer given in the comments, which is probably the correct one if you are using a modern version of Docker (in my case v20.10.5) and the logs do not show the expected output, when, for example, you run RUN ls
.
You should use the option --progress <string>
in the docker build
command:
--progress string Set type of progress output (auto, plain, tty). Use plain to show container output
(default "auto")
For example:
docker build --progress=plain .
In the latest versions of docker, the classic build engine that docker ships with has been upgraded to Buildkit, which displays different information.
You should see output like:
#12 [8/8] RUN ls -alh
#12 sha256:a8cf7b9a7b1f3dc25e3a97700d4cc3d3794862437a5fe2e39683ab229474746c
#12 0.174 total 184K
#12 0.174 drwxr-xr-x 1 root root 4.0K Mar 28 19:37 .
#12 0.174 drwxr-xr-x 1 root root 4.0K Mar 28 19:35 ..
#12 0.174 drwxr-xr-x 374 root root 12.0K Mar 28 19:37 node_modules
#12 0.174 -rw-r--r-- 1 root root 1.1K Mar 28 19:36 package.json
#12 0.174 -rw-r--r-- 1 root root 614 Mar 28 15:48 server.js
#12 0.174 -rw-r--r-- 1 root root 149.5K Mar 28 16:54 yarn.lock
#12 DONE 0.2s
As noted by @venimus in the comments, you may also need --no-cache
because cached containers do not show any output.
Related question with more details.
Step 10/20 : RUN file="$(conda list --explicit)" && echo $file ---> Using cache ---> 66f20d5489c0 Step 11/20 : RUN echo $(conda list --explicit) ---> Using cache ---> f923669d8444
... – Human