If you want to explore the Docker container’s file system, you can use on of the following methods.
Using the docker exec command
Docker version 1.3 or newer supports the docker exec command. This command can run new process in an already running container. This means you can run bash /bin/bash in the container state like this:
Using Snapshotting
You can evaluate the docker file system by following these steps:
- Find the id of your running container
- Create an image (snapshot) from the container file system
- Explore the file system using the bash
This way, you can evaluate the filesystem of the running container at the precise time moment. The container is still running, no future changes are included.
To delete the snapshot, run the following command:
Using the ssh
If you want a continuous access to the docker file system, you can install the sshd to your container and run the sshd daemon:
To see to which port to connect, run the following command:
If you are new to Docker, feel free to start with our Getting started logging guide.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.