Reputation: 6906
On a mac, docker utilizes HyperKit in order to create a LinuxKit VM. This means, for example, among other things, that I cannot see any of the image layers that are pulled down for a given container in places like /var/lib/docker
, since the VM controls all of that.
Is there a way to actually get a shell on that VM to be able to do that sort of introspection?
Upvotes: 2
Views: 1006
Reputation: 6906
In Docker Desktop 2.4 for Mac, it is possible to get a nearly full terminal into the LinuxKit VM, with sane tab auto-completion, and be able to inspect its contents.
For example, to see the layers of pulled down docker images, you may perform the following commands:
$ stty -echo -icanon && nc -U ~/Library/Containers/com.docker.docker/Data/debug-shell.sock && stty sane
/ # ls -al /var/lib/docker/overlay2/
The nc -U ~/Library/Containers/com.docker.docker/Data/debug-shell.sock
may be run on its own, per the Docker release docs, but if it is not combined with stty
per the above example, you will not see very good output, nor will you have tab completion in the vm.
Upvotes: 6