Is it possible to have a GUI file explorer (e.g. like winscp/windows or nautilus/linux) on my host machine that can show the filesystem of a running docker container?
Primarily interested in a GUI for Linux/Ubuntu
Docker uses cgroups for isolation.
You should be able to browse the docker container's filesystem directly via the procfs
. Specifically, if you browse /proc/<pid>/root/
, where <pid>
is the PID of a process within the container.
From the Moby issue tracker:
docker inspect --format {{.State.Pid}} $YOUR_CONTAINER
Should give you a PID.
Therefore, from the command line, you could cd
into:
/proc/$(docker inspect --format {{.State.Pid}} $YOUR_CONTAINER)/root
You should then be able to browse to that same directory from your GUI file browser. However, you likely will not be able to use the $()
construct directly, which leaves you with either:
or
/proc/123/root
/proc
you can always symlink a different directory to there and browse to that one. Or you can bind mount it. etc etc ...