docker / docker/cli

Proposal: 'volume inspect' should show data usage

Open
#574 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/volumes kind/enhancement version/17.07
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description
For practical needs I propose the cli show the volume size on the default inspect format, so the user don't have to run

docker volume system df 

or

docker volume system df -v

To realize the current size of the running volume.

Just don't want to make a PR before asking. If approved I'll make the PR.

Actual behavior:

[
    {
        "CreatedAt": "2017-09-29T09:14:12-05:00",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "myApp",
            "com.docker.compose.volume": "db-postgres"
        },
        "Mountpoint": "/var/lib/docker/volumes/myApp_db-postgres/_data",
        "Name": "myApp_db-postgres",
        "Options": {},
        "Scope": "local"
    }
]

Proposal behavior:

[
    {
        "CreatedAt": "2017-09-29T09:14:12-05:00",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "myApp",
            "com.docker.compose.volume": "db-postgres"
        },
        "Mountpoint": "/var/lib/docker/volumes/myApp_db-postgres/_data",
        "Name": "myApp_db-postgres",
        "Options": {},
        "Size": "90MB",
        "Scope": "local"
    }
]

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      17.07.0-ce-rc2
 API version:  1.31
 Go version:   go1.8.3
 Git commit:   36ce605
 Built:        Mon Aug  7 23:45:34 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.07.0-ce-rc2
 API version:  1.31 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   36ce605
 Built:        Mon Aug  7 23:46:55 2017
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 10
 Running: 8
 Paused: 0
 Stopped: 2
Images: 68
Server Version: 17.07.0-ce-rc2
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 3addd840653146c90a254301d6c3a663c7fd6429
runc version: 2d41c047c83e09a6d61d464906feb2a2f3c52aa4
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.12.13-300.fc26.x86_64
Operating System: Fedora 26 (Workstation Edition)
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 15.59GiB
Name: Highwind
ID: 2WLY:Z6ID:XV65:VHRM:JBQR:W67K:R3JQ:ISDF:V5PY:CNRN:Q3VX:TSWF
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
physical

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the docker volume inspect CLI entry point and compare its current output with docker volume system df -v. Determine how volume data usage can be obtained for the inspect response; done means the default inspect output includes a size value like the proposed Size field.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.