Answers for "add volume to docker container"

11

docker mount volume

docker run -v /host/directory:/container/directory -other -options image_name command_to_run
Posted by: Guest on September-16-2020
1

docker create volume

$ docker volume create hello

hello

$ docker run -d -v hello:/world busybox ls /world
Posted by: Guest on October-05-2020
0

docker add volumes to running container

$ docker ps  -a
CONTAINER ID        IMAGE                 COMMAND                  CREATED              STATUS                          PORTS               NAMES
    5a8f89adeead        ubuntu:14.04          "/bin/bash"              About a minute ago   Exited (0) About a minute ago                       agitated_newton

$ docker commit 5a8f89adeead newimagename

$ docker run -ti -v "$PWD/somedir":/somedir newimagename /bin/bash
Posted by: Guest on March-21-2021

Code answers related to "add volume to docker container"

Python Answers by Framework

Browse Popular Code Answers by Language