New

Run a Container with Persistent Storage

Attaches a named volume so the data survives removing and recreating the container.

Without a volume, everything a container writes lives in its writable layer and disappears with docker rm. A named volume is managed by Docker; a bind mount (-v /host/path:/container/path) maps a directory you already have.

When you need this: Any container holding state: a database, uploads, or a configuration directory.

Variables

Command


        
3 views 0 copies
Log in to rate
Log in to save

Free account. Save snippets into your own collections.