I follow the link https://docs.docker.com/get-started/docker-concepts/building-images/multi-stage-builds/ and I can successfully run the container and image spring-helloworld, but where is the image, container really in?
I type all my command in Ubuntu terminal, and in docker.desktop, container, inspect, the hostsPath is “”/var/lib/docker/containers/dd739300dd52be7c8f410f228a07bfa92fdd5b822e1c273b120ec9b8077b2765/hosts", but no /var/lib/docker in my Ubuntu, even sudo to root by
sudo su -
the result is
cd /var/lib/docker/
-bash: cd: /var/lib/docker/: No such file or directory
if I type
docker exec crazy_volhard /bin/bash
it returns
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
(crazy_volhard is the container name for image spring-helloworld.)
And I google and some said in docker desktop, it create docker in a VM and the image is in the VM, not in the host.
But in my whole process, I use terminal to run
docker build -t spring-helloworld .
this also mean I build the docker image using docker desktop, not docker engine?
And If I type
docker context ls
it returns
NAME DESCRIPTION DOCKER ENDPOINT ERROR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock
desktop-linux * Docker Desktop unix:///home/userA/.docker/desktop/docker.sock