Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

docker mount volume

# create volume named ubuntu_data
volume create ubuntu_data

# inspect the volume created
docker volume inspect ubuntu_data

# attach the ubutu_data volume to a folder named volume_data 
# in ubuntu then run ubuntu container by image name
docker run -it -v ubuntu_data:/volume_data ubuntu

# stop all docker running activities
docker system prune

# list all volumes for docker
docker volume ls

# delete the volume named ubuntu_data is no longer used
docker volume -rm ubuntu_data
Source by codefreelance.net #
 
PREVIOUS NEXT
Tagged: #docker #mount #volume
ADD COMMENT
Topic
Name
8+5 =