Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate Blobsum in Manifest.FSLayers #1527

Closed
jgsqware opened this issue Mar 14, 2016 · 3 comments
Closed

Duplicate Blobsum in Manifest.FSLayers #1527

jgsqware opened this issue Mar 14, 2016 · 3 comments

Comments

@jgsqware
Copy link

jgsqware commented Mar 14, 2016

Hello,

I've a question abot Blobsum in Manifest.

I'm uploading a image in registry v2.2.1.

In the registry folder I have 6 layers:
ls repositories/jgsqware/ubuntu-git/_layers/sha256/

13be4a52fdee2f6c44948b99b5b65ec703b1ca76c1ab5d2d90ae9bf18347082e  9e0bc8a71bde464f710bc2b593a1fc21521517671e918687892303151331fa56
27aa681c95e5165caf287dcfe896532df4ae8b10e099500f2f8f71acf4002a89  a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
91ff81047b9e73d6787c9dfa64c8387e1f6a184b7a00da2195b755b0ff3cf360  d89e1bee20d9cb344674e213b581f14fbd8e70274ecf9d10c514bab78a307845

but when I get the manifest, I received duplicate layers in Blobsum:

{
   "schemaVersion": 1,
   "name": "jgsqware/ubuntu-git",
   "tag": "latest",
   "architecture": "amd64",
   "fsLayers": [
      {
         "blobSum": "sha256:13be4a52fdee2f6c44948b99b5b65ec703b1ca76c1ab5d2d90ae9bf18347082e"
      },
      {
         "blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"
      },
      {
         "blobSum": "sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4"
      },
      {
         "blobSum": "sha256:27aa681c95e5165caf287dcfe896532df4ae8b10e099500f2f8f71acf4002a89"
      },
      {
         "blobSum": "sha256:9e0bc8a71bde464f710bc2b593a1fc21521517671e918687892303151331fa56"
      },
      {
         "blobSum": "sha256:d89e1bee20d9cb344674e213b581f14fbd8e70274ecf9d10c514bab78a307845"
      }
   ],
   "history": [
      {
         "v1Compatibility": "{\"architecture\":\"amd64\",\"author\":\"jgsqware \\u003cjgonzalez@wemanity.com\\u003e\",\"config\":{\"Hostname\":\"c944455e5c4d\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/bash\"],\"Image\":\"4009573363bc59c6975777a862bcbd69ccaddbbf56e3d8ce6a554640148b24da\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":[],\"Labels\":{}},\"container\":\"72532c96e12c4203bb073b205f6db53fa795d08eaed25e18beff0203550e6447\",\"container_config\":{\"Hostname\":\"c944455e5c4d\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"apt-get update \\u0026\\u0026 apt-get install -y     aufs-tools     automake     build-essential     curl     dpkg-sig     libcap-dev     libsqlite3-dev     lxc=1.0*     mercurial     reprepro     ruby1.9.1     ruby1.9.1-dev     s3cmd=1.1.*  \\u0026\\u0026 apt-get clean  \\u0026\\u0026 rm -rf /var/lib/apt/lists/*\"],\"Image\":\"4009573363bc59c6975777a862bcbd69ccaddbbf56e3d8ce6a554640148b24da\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":[],\"Labels\":{}},\"created\":\"2016-01-19T07:50:59.115766055Z\",\"docker_version\":\"1.9.1\",\"id\":\"7f5e0d12da7abc7eade540b003a86ed4ee2fc3c60277502c03c2165dedf31fbd\",\"os\":\"linux\",\"parent\":\"1a151cf658acd36a1d823e97ec652b7c63509d8dd515c8e06cc7c392d6fd3e00\"}"
      },
      {
         "v1Compatibility": "{\"id\":\"1a151cf658acd36a1d823e97ec652b7c63509d8dd515c8e06cc7c392d6fd3e00\",\"parent\":\"2b90b5e0b7e04b27d0d86aa4f9228de556dfca1123b9515d0db4d5fa61f7828f\",\"created\":\"2016-01-19T07:46:39.292462296Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c #(nop) MAINTAINER jgsqware \\u003cjgonzalez@wemanity.com\\u003e\"]}}"
      },
      {
         "v1Compatibility": "{\"id\":\"2b90b5e0b7e04b27d0d86aa4f9228de556dfca1123b9515d0db4d5fa61f7828f\",\"parent\":\"c99250c3d21b7031352bf8c5208d1e68610209daa25b9642f4cc46fff9965bec\",\"created\":\"2016-01-04T18:47:15.234316812Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c #(nop) CMD [\\\"/bin/bash\\\"]\"]}}"
      },
      {
         "v1Compatibility": "{\"id\":\"c99250c3d21b7031352bf8c5208d1e68610209daa25b9642f4cc46fff9965bec\",\"parent\":\"e8c4620d3f97f66366f2d15be81a32bee44e9ca51a02bc5df68035c6002df86e\",\"created\":\"2016-01-04T18:47:14.655339151Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c sed -i 's/^#\\\\s*\\\\(deb.*universe\\\\)$/\\\\1/g' /etc/apt/sources.list\"]}}"
      },
      {
         "v1Compatibility": "{\"id\":\"e8c4620d3f97f66366f2d15be81a32bee44e9ca51a02bc5df68035c6002df86e\",\"parent\":\"b303be58318bb70f0e9c14bbb44fd808a7d1bd0f672fc71e814731c743ff96ba\",\"created\":\"2016-01-04T18:47:13.143412412Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c echo '#!/bin/sh' \\u003e /usr/sbin/policy-rc.d \\t\\u0026\\u0026 echo 'exit 101' \\u003e\\u003e /usr/sbin/policy-rc.d \\t\\u0026\\u0026 chmod +x /usr/sbin/policy-rc.d \\t\\t\\u0026\\u0026 dpkg-divert --local --rename --add /sbin/initctl \\t\\u0026\\u0026 cp -a /usr/sbin/policy-rc.d /sbin/initctl \\t\\u0026\\u0026 sed -i 's/^exit.*/exit 0/' /sbin/initctl \\t\\t\\u0026\\u0026 echo 'force-unsafe-io' \\u003e /etc/dpkg/dpkg.cfg.d/docker-apt-speedup \\t\\t\\u0026\\u0026 echo 'DPkg::Post-Invoke { \\\"rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true\\\"; };' \\u003e /etc/apt/apt.conf.d/docker-clean \\t\\u0026\\u0026 echo 'APT::Update::Post-Invoke { \\\"rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true\\\"; };' \\u003e\\u003e /etc/apt/apt.conf.d/docker-clean \\t\\u0026\\u0026 echo 'Dir::Cache::pkgcache \\\"\\\"; Dir::Cache::srcpkgcache \\\"\\\";' \\u003e\\u003e /etc/apt/apt.conf.d/docker-clean \\t\\t\\u0026\\u0026 echo 'Acquire::Languages \\\"none\\\";' \\u003e /etc/apt/apt.conf.d/docker-no-languages \\t\\t\\u0026\\u0026 echo 'Acquire::GzipIndexes \\\"true\\\"; Acquire::CompressionTypes::Order:: \\\"gz\\\";' \\u003e /etc/apt/apt.conf.d/docker-gzip-indexes\"]}}"
      },
      {
         "v1Compatibility": "{\"id\":\"b303be58318bb70f0e9c14bbb44fd808a7d1bd0f672fc71e814731c743ff96ba\",\"created\":\"2016-01-04T18:47:07.927160562Z\",\"container_config\":{\"Cmd\":[\"/bin/sh -c #(nop) ADD file:482777a8ad62044151087a0dd81f22cb67585db07dfdda686202477d0c6ba0ae in /\"]}}"
      }
   ],
   "signatures": [
      {
         "header": {
            "jwk": {
               "crv": "P-256",
               "kid": "JHV2:HQTM:57GG:52SF:OEIH:6A3Q:OSBC:5BRN:OZBW:7FA3:YOP4:6M56",
               "kty": "EC",
               "x": "xiWZGxa_L4Z_ixshzBUfzumFaJw_kSL1gfvV85y3Jxo",
               "y": "Ar37m2wIbDcwdu-9Gwf7nuzxZiTYpL-EzQnN56p3ZaM"
            },
            "alg": "ES256"
         },
         "signature": "xhD6GofqFWapmZMQ13-oW7fX01GwSn6C1WqPHauKGEs6OtAXRBBoavx2bOAiNKyRpwXQYOCN1QPNZf1IUs6phQ",
         "protected": "eyJmb3JtYXRMZW5ndGgiOjU1MDAsImZvcm1hdFRhaWwiOiJDbjAiLCJ0aW1lIjoiMjAxNi0wMy0xNFQwNzoxNzoxMloifQ"
      }
   ]
}

Is it normal and when I want to pull a layer, I should get it with /v2//blobs/ ?

Thanks

@RichardScothern
Copy link
Contributor

RichardScothern commented Mar 14, 2016

fsLayers andhistory` are parallel arrays: the digest in each blobsum represents the filesystem used by the container at that point in the history array. If no new file was added in the commit, they would be the same.

Layers are pulled through the blobs endpoint: https://github.com/docker/distribution/blob/master/docs/spec/api.md#pulling-a-layer

@jgsqware
Copy link
Author

jgsqware commented Mar 15, 2016

OK thanks so in the final image the commit "maintainer" will not be part of the image really. It's just in the Docker file ?

@RichardScothern
Copy link
Contributor

RichardScothern commented Mar 15, 2016

The maintainer is in the container configuration (which is embedded within one of the v1compatibility structs).

Note, in schema version 2 (supported in Docker 1.10 / registry 2.3.0) the structure is different and the container config is stored differently
https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-1.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants