4

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

1 Answer 1

3

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:

  • Using a CLI to launch a GUI file explorer pointing to that path

or

  • Using a CLI to retrieve the PID and then browse directly there in the GUI, e.g. /proc/123/root
1
  • Unfortunately, I don't actually have X installed so I can't test either method. However, if, say, Nautilus refuses to browse into /proc you can always symlink a different directory to there and browse to that one. Or you can bind mount it. etc etc ...
    – Bob
    Commented Jan 23, 2018 at 7:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .