# docker volume Command Reference

> Reference for docker volume in CI: create, list, inspect, remove, and prune named volumes for persisting or sharing data between containers in pipelines.

Source: https://latchkey.dev/learn/command-reference/docker-volume-command-reference  
Updated: 2026-06-26

Manage named volumes.

docker volume groups the volume subcommands: create, ls, inspect, rm, and prune. Named volumes persist data outside a container lifecycle and are the recommended way to share or cache data between containers in a pipeline.

## Common subcommands

- `docker volume create NAME` - create a named volume
- `docker volume ls` - list volumes (-q for names only)
- `docker volume inspect NAME` - show volume metadata as JSON
- `docker volume rm NAME` - remove a volume
- `docker volume prune -f` - remove all unused volumes

## Example

```shell
docker volume create pgdata
docker run -d --name db -v pgdata:/var/lib/postgresql/data postgres:16
docker volume prune -f
```

## In CI

Use a named volume to persist a database between steps within a job, or to share a cache directory between containers. docker volume prune -f reclaims unused volumes on a persistent runner; a volume in use by any container is skipped.

## FAQ

### docker volume Command Reference?

docker volume groups the volume subcommands: create, ls, inspect, rm, and prune. Named volumes persist data outside a container lifecycle and are the recommended way to share or cache data between containers in a pipeline.

### In CI?

Use a named volume to persist a database between steps within a job, or to share a cache directory between containers. docker volume prune -f reclaims unused volumes on a persistent runner; a volume in use by any container is skipped.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
