skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
docker-volumes
This page is read only. You can view the source, but not change it.
# Docker volumes **Volumes** persist data beyond container lifetime. By default, containers are ephemeral—data disappears when they stop. A **bind mount** maps a host directory into the container. A **named volume** lets Docker manage storage; you refer to it by name and can mount it into multiple containers. ```bash $ docker run -v /host/path:/container/path myapp # bind mount $ docker run -v mydata:/data myapp # named volume $ docker volume create mydata # create a named volume $ docker volume ls # list volumes $ docker volume rm mydata # delete a volume ``` Bind mounts are simple but tight coupling to the host. Named volumes are cleaner for production—Docker manages the location and you don't need to know where files actually live. Multiple containers can mount the same named volume, but you must handle concurrent writes yourself.
Page Tools
Show pagesource
Backlinks
Back to top