SSH into Running Docker Containers with docker exec The base image to create the container from ( ubuntu).Ĭreating the new folder on tmp directory in a Docker containerįinally, when you’re done running commands, type exit to close the session.The t flag allocates a pseudo-TTY which much be used to run commands interactively.
The i flag does not close the SSH session even if the container is not attached.
I found one forum post mentioning that data in /var/lib/docker will be preserved, but I could not find any official docs stating that and it also seems strange considering the persistent storage guide above doesn't use this path or even mention that your data will be deleted.
I can't find documentation on what is happening. However "docker-machine restart " clears out this custom data on the vm. I checked that this data is indeed stored on the boot2docker VM (created by docker-machine) and not on the container, so that it will persist. I've created a data volume container for storing persistent data.