Home > other >  Docker images and containers change when docker desktop is running on linux
Docker images and containers change when docker desktop is running on linux

Time:09-23

When docker desktop is running on linux, I see a different set of containers and images compared to when it is not running. That is, when I run docker images in the terminal, the output depends on whether docker desktop is running or not. After I 'quit docker desktop', the original behavior is restored.

I note the following changes:

docker desktop is off docker desktop is running
images 'a, b, c' shows images 'd, e, f'
containers 'aa, bb, cc' containers 'dd, ee, ff'
non colored cli output pretty colored cli output

My suspicion is that docker desktop kills a running docker service and starts a fresh one whose images and containers are located elsewhere on my filesystem. Then after quitting, the original service is restored. I'd like this behavior to change, such that the images and containers I'm working on are always the same, regardless of whether docker desktop is running or not.

I'm looking for some feedback on how to start debugging this.

CodePudding user response:

Docker only runs natively on Linux. Docker Desktop is the "hack" that allows running docker on other platforms (MacOS, Windows, etc). Docker Desktop actually starts a Linux VM and runs docker inside that VM. It then takes care of mapping ports and volumes so that it appears to the end user that docker is "running directly on host".

The beauty of running Docker on linux is that it runs natively and you don't need extra hacks and tricks. So why you would use Docker Desktop on Ubuntu.... beats me :) However, the explanation of why you see different results is becuase you see different docker processes running on different machines: one on the host and one on a VM.

  • Related