[1.13.0-rc5] Docker Image Size reported as -1 in 1.11/1.12 client #30027

Closed
BenHall opened this Issue Jan 10, 2017 · 4 comments

Projects

None yet

5 participants

@BenHall
Contributor
BenHall commented Jan 10, 2017

When the server is running Docker 1.13.0-rc5, when the client runs docker images the sizes will be reported as -1

$ docker version
Client:
 Version:      1.11.1
 API version:  1.23
 Go version:   go1.5.4
 Git commit:   5604cbe
 Built:        Wed Apr 27 00:34:20 2016
 OS/Arch:      darwin/amd64

Server:
 Version:      1.13.0-rc5
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   43cc971
 Built:        Thu Jan  5 03:07:30 2017
 OS/Arch:      linux/amd64
$ docker images
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
katacoda/docker-http-server       large               1e023cfd8ba8        18 hours ago        -1 B
katacoda/docker-http-server       latest              c6dfc1d5003f        18 hours ago        -1 B
katacoda/docker-http-server       v1                  c6dfc1d5003f        18 hours ago        -1 B

Upgrading the client to Docker 1.13 fixes the issue.

$ docker version
Client:
 Version:      1.13.0-rc5
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   43cc971
 Built:        Thu Jan  5 03:07:30 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      1.13.0-rc5
 API version:  1.25 (minimum version 1.12)
 Go version:   go1.7.3
 Git commit:   43cc971
 Built:        Thu Jan  5 03:07:30 2017
 OS/Arch:      linux/amd64
 Experimental: false
$ docker images
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
katacoda/docker-http-server       large               1e023cfd8ba8        18 hours ago        771 MB
katacoda/docker-http-server       latest              c6dfc1d5003f        18 hours ago        7.59 MB
katacoda/docker-http-server       v1                  c6dfc1d5003f        18 hours ago        7.59 MB
@yongtang
Contributor

The issue seems to be that for version <= v1.24, Size is used while for version >= v1.25 VirtualSize is used.
v1.24:

  {
    "Id": "sha256:138c2e6554219de65614d88c15521bfb2da674cbb0bf840de161f89ff4264b96",
    "ParentId": "",
    "RepoTags": [
      "golang:1.7.0"
    ],
    "RepoDigests": [
      "golang@sha256:6765038c2b8f407fd6e3ecea043b44580c229ccfa2a13f6d85866cf2b4a9628e"
    ],
    "Created": 1472598127,
    "Size": 669617897,
    "VirtualSize": 669617897,
    "Labels": {}
  }

v1.25:

  {
    "Containers": -1,
    "Created": 1472598127,
    "Id": "sha256:138c2e6554219de65614d88c15521bfb2da674cbb0bf840de161f89ff4264b96",
    "Labels": {},
    "ParentId": "",
    "RepoDigests": [
      "golang@sha256:6765038c2b8f407fd6e3ecea043b44580c229ccfa2a13f6d85866cf2b4a9628e"
    ],
    "RepoTags": [
      "golang:1.7.0"
    ],
    "SharedSize": -1,
    "Size": -1,
    "VirtualSize": 669617897
  }

The easiest fix is to copy Size to VirtualSize in version <= v1.24 I think.

@yongtang
Contributor

Created a PR #30061 to try to address the issue.

@thaJeztah thaJeztah closed this in #30061 Jan 13, 2017
@StefanScherer
Contributor

Oops, I have seen that in December at TechSummit demoing a Win2016 daemon from my Mac, but didn't want to bother you with yet another tiny windows "flaw". Will try to send issues faster :-)

@thaJeztah
Member

@StefanScherer yes, it looked like a small issue, but we were discussing that it's a change in the API, so important to fix before release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment