Manage Docker volumes
high risk
docker run --rm -v <vol>:/data -v $PWD:/backup alpine tar czf /backup/vol.tgz /dataBack up a volume firstCreate, list and remove volumes. See the flags and examples below, and run `man docker` for the full reference.
| Flag | Meaning |
|---|---|
ls | List volumes |
inspect | Details |
rm | Remove volumes⚠ Permanent data loss. |
prune | Remove unused volumes⚠ Deletes data. |
docker volume lsList · explain & risk-check →docker volume inspect pgdataWhere is it stored? · explain & risk-check →Reference text is hand-written and may be incomplete — check man docker for your version. Test destructive commands on a non-production system first.