Docker add volume to running container

Posted on by

Understanding and Managing Docker Container Volumes

docker add volume to running container

Docker: Port and Volume Mapping

2017   per   2017

Share your experiences and ideas with other members. Learn how Docker handles container storage volumes, how to launch a container with a volume from the command line and from a Dockerfile, and how to share volumes between containers. In order to understand Docker volumes, it is important to first understand how the Docker file system works. A Docker image is a collection of read-only layers. When you launch a container from an image, Docker adds a read-write layer to the top of that stack of read-only layers. Docker calls this the Union File System.

Get the latest tutorials on SysAdmin and open source topics. Write for DigitalOcean You get paid, we donate to tech non-profits. DigitalOcean Meetups Find and meet other developers in your city. Become an author. Docker is a popular containerization tool used to provide software applications with a filesystem that contains everything they need to run.

This is my first post to get some help on docker issue that my customer is facing though I am not expert in docker, but I did good amount of research before posting this. Only port was listed there. Another thing is, when I asked to run inspect command to get mount details, they provided below;. The above seems to be data volumes. I have a similar docker image with me and replicated issue locally.

By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service. Setup a private space for you and your coworkers to ask questions and share information. I immediately started installing Java and some other tools, spend some time with it and stopped the container by. Then I wanted to add a volume and realised that this is not as straightforward as I thought it would be. All the documentation about mounting a folder from the host seems to imply that mounting a volume is something that can be done when creating a container. So the only option I have to avoid reconfiguring a new container from scratch is to commit the existing container to a repository and use that as the basis of a new one whilst mounting the volume.

Subscribe to RSS

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together., It has been asked on docker-dev recently if it was possible to attach a volume to a container after it was started.

Attach a volume to a container while it is running




Docker Community Forums





4 thoughts on “Docker add volume to running container

  1. Volumes are the preferred mechanism for persisting data generated by and used by Docker containers.

Leave a Reply