I am just starting out with Docker. I have this Dockerfile:
FROM jonathonf/manjaro
CMD ["pacman", "-S", "--noconfirm", "git"]
When I build the image with
sudo docker build -t uname/description:tag .
and then run it with
sudo docker run IMAGE_ID
, where IMAGE_ID
is the ID I get from sudo docker images
command, the command in the Dockerfile CMD ["pacman", "-S", "--noconfirm", "git"]
runs, git is installed, a container is created (that I can commit).
If I run the image with
sudo docker run IMAGE_ID /bin/bash
the CMD
from the Dockerfile is not executed.
I expected it to run the commands from the Dockerfile, make git
available in the container and let me work further in the shell.