0

EDIT: I figured it out: I built the container without the run command, and it seems that it had downloaded miniconda as ' Miniconda.sh' with a space -.- so all my other commands were missing. Thank you!

This is my Dockerfile.

#
# Building a docker image with the latest ubuntu version and basic python install
#
# latest ubuntu version
FROM ubuntu:latest

# information about maintainer
MAINTAINER yves

# add the bash script
ADD install.sh /
# change rights for the script
RUN chmod u+x /install.sh
# run the bash script
RUN /install.sh
# prepend the new path
ENV PATH /root/miniconda3/bin:$PATH

# execute IPython when container is run
CMD ["ipython"]

When I build with

docker build -t pyalgo:basic .

However, it shows in the logs that not every command is executing.

enter image description here

Only four commands are executed in the log:

 => CACHED [1/4] FROM docker.io/library/ubuntu:latest                                                                                                          0.0s
 => [2/4] ADD install.sh /                                                                                                                                     0.0s
 => [3/4] RUN chmod u+x /install.sh                                                                                                                            0.3s
 => [4/4] RUN /install.sh 

I have tried to find out why this is happening but I don't get it. It seems to be finding the file and everything.

EDIT: I tried using the following advice about --progress, but it still seems to only use 4 commands: enter image description here

  • Does this answer your question? [Why is docker build not showing any output from commands?](https://stackoverflow.com/questions/64804749/docker-build-not-showing-any-output-from-commands) – Gino Mempin Jul 21 '21 at 02:15
  • @GinoMempin I tried showing more output, but it does not seem to be an output problem, as using --progress=plain still shows only 4 commands – burneverything1 Jul 21 '21 at 02:39
  • Are you expecting `MAINTAINER` and the last `CMD` to be shown as well? – Gino Mempin Jul 21 '21 at 07:30

2 Answers2

0

Docker now uses BuildKit by default to build Linux containers.

If you want to see all the build steps, you can either use --progress in BuildKit:

docker build --progress=plain ...

or, you can ask Docker to use the classic builder over BuildKit:

DOCKER_BUILDKIT=0 docker build ...
Eranga Heshan
  • 5,133
  • 4
  • 25
  • 48
  • I suspected that it wasn't executing all the steps because things that should have been installed were not. I tried using the --progress tag, but it still seems like only 4 steps are being executed. – burneverything1 Jul 21 '21 at 02:36
  • What is the full command you used? And did you try the second command? – Eranga Heshan Jul 21 '21 at 05:00
0

EDIT: I figured it out: I built the container without the run command, and it seems that it had downloaded miniconda as ' Miniconda.sh' with a space -.- so all my other commands were missing. Thank you!