Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

docker-volumes

> 编程语言
Open source

Docker Volume Manager

369 stars0 likes1 views
WebsiteGitHub

About

Docker Volume Manager

Docker Volume Manager

WARNING

Docker 1.7 introduced some changes that broke functionality in this project. Docker 1.8 introcuded yet more changes that broke functionality here. This has always been intended as a way to prototype this functionality for Docker itself. Being that native docker volumes support is planned for Docker 1.9 and the maintainence burden this project brings, I am no longer going to maintain this. I will happily accept pull requests to fix issues, but will not provide any new fixes. Sorry for the inconveniece, and thank you for helping out with this project!


This is a tool for managing your Docker volumes.

Basically, since volumes are not yet first-class citizens in Docker they can be difficult to manage. Most people tend to have extra volumes laying around which are not in use because they didn't get removed with the container they were used with.

You can run this tool remotely just as you do with the Docker CLI. It reads DOCKER_HOST or you can specify a host using the same syntax as with Docker, with -H unix:///path/to/sock.sock or --host unix:///path/to/sock.sock. This also works with TCP endpoints

Use this to see all your volumes, inspect them, export them, or clean them up.

The primary goal of this project is to spec out UI/API for inclusion in Docker. Some of the implementation is hacky since I specifically wanted the CLI for this to act just like the Docker CLI, that is that it doesn't need to be running on the host or have access to the host's filesystem for it to work.

Caveats

The export function is horribly inefficient, for a couple of reasons:

  1. The tools is inteded to be used remotely, so there is no direct access to the host FS, and as such the volumes or container filesystems.

  2. The docker cp command, and the corresponding APIs, do not support volumes. For instance you cannot do docker cp jolly_torvalds:/path/to/volume like you can for things not in volumes. Well, you can, but it won't be the data in the volume... it will be the data at that location from the container's FS

To work around these issues the export function actually copies data from a volume into a container's FS, then uses the docker cp APIs to pull it.

Installation

You can download a pre-built binary from the releases section. Or you can use the docker image as such:

bash
docker run -v /var/run/docker.sock:/var/run/docker.sock cpuguy83/docker-volumes list

Building

You can use the provided Dockerfile.build which will compile a binary for you or build yourself.

bash
git clone https://github.com/cpuguy83/docker-volumes.git
cd docker-volumes
docker build -t docker-volumes -f Dockerfile.build .
docker run --name docker-volumes docker-volumes
docker cp docker-volumes:/docker-volumes ./

By default when compiling from the Dockerfile it will compile for linux/amd64. You can customize this using environment variables as such:

bash
docker run --name docker-volumes -e GOOS=darwin -e GOARCH=amd64 docker-volumes

This would make a binary for darwin/amd64 (OSX), available for docker cp at the same location as above.

Alternatively, if you already have golang installed on your system you can compile it yourself:

bash
git clone https://github.com/cpuguy83/docker-volumes.git
cd docker-volumes
go get
go build

Usage

Commands:

  • list - Lists all volumes on the host
  • inspect - Get details of a volume, takes ID or name from output of list
  • rm - Removes a volume. A volume is only removed if no containers are using it
  • export - Creates an archive of the volume and outputs it to stdout. You can optionally pause all running containers (which are using the requested volume) before exporting the volume using --pause
  • import - Import a tarball generated by the export command from stdin to a specified container. Be default it will import it into the same directory path the volume existed on (eg, if it came from /data, it will put it into /data) You can optionally specify a different volume path, but a volume must exist at that path already or you will get an error
…

Examples

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言