Skip to content

Volumes — by Docker Docs

intermediatepageLink only (©)

Docs on persisting container data with volumes, which Docker calls the preferred mechanism, versus bind mounts that tie you to the host's folder layout. Mentions read-only mounts, subdirectory mounts, volume drivers for NFS/CIFS, and the gotcha that mounting over a non-empty directory hides its existing files. Volumes are not removed automatically when a container is deleted.

Quick steps

  1. Use --mount rather than --volume when you need driver options or subpaths
  2. Clean up unused volumes with docker volume prune

Paraphrased from the source. Menus can differ by version, so check the original for full details.

Read the full article on docs.docker.com

Source: Volumes by Docker Docs. Licence: Link only (©).

Source reviewed
2026-11-02
Link checked
2026-11-02
Tested hands-on
Not by Oddbyte.Me

dockervolumesbind mountsstorage

More in Docker & Containers