skopeo inspect docker://reg.docker.alibaba-inc.com/ray_deploy/alios7u2-min:1.0_nydus_v2

    1. {
    2. "Name": "reg.docker.alibaba-inc.com/ray_deploy/alios7u2-min",
    3. "Digest": "sha256:ce4ddaa7db3e7f1aebde0c91b0d74d096a6777fd1a6af6b4094e6148fda6187d",
    4. "RepoTags": [
    5. "1.0",
    6. "1.0_nydus_v2"
    7. ],
    8. "Created": "2021-02-04T07:19:11.851931645Z",
    9. "DockerVersion": "",
    10. "Labels": null,
    11. "Architecture": "amd64",
    12. "Os": "linux",
    13. "Layers": [
    14. // compressed-diff-digest
    15. "sha256:58f95076ebeba2a79f6b786ec216b51c74a6d3ead24c2537ce0f84ae974803c7"
    16. ],
    17. "Env": [
    18. "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    19. "container=docker"
    20. ]
    21. }

    skopeo inspect —config docker://reg.docker.alibaba-inc.com/ray_deploy/alios7u2-min:1.0_nydus_v2

    1. {
    2. "created": "2021-02-04T07:19:11.851931645Z",
    3. "architecture": "amd64",
    4. "os": "linux",
    5. "config": {
    6. "Env": [
    7. "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
    8. "container=docker"
    9. ],
    10. "Cmd": [
    11. "/sbin/init"
    12. ]
    13. },
    14. "rootfs": {
    15. "type": "layers",
    16. "diff_ids": [
    17. //非压缩的diff-digest,overlay-layers下的目录
    18. "sha256:64ab458946b28f56485b972e599da73f5a7b176ecdf050bb5740c6638c959325"
    19. ]
    20. }
    21. }

    overlay-images/${imageId}/manifest 存储了该镜像所有layer的 非压缩sha256 和layer大小。

    overlay-layers/layers.json 存储了所有layer的 非压缩sha256 、压缩sha256、layer id等信息。layer id就是放在overlay-layers目录下的layer文件名。

    images recorded in a registry should be compressed,and ordinarily the compression is accompanied with an update to the MIME type。在本地build镜像时,在本地存储的可能是未压缩的layer文件,它的media type是没有gzip。在docker registry中存储的layer都是压缩过的,压缩完成之后会同时修改media type。上传的layer理论上不应该出现未压缩的layer。

    1. [{
    2. "id": "2d065512630f97ed1172a4de9e654bff7fff0ed2839eec730936ffa21667d048",
    3. "parent": "81ef8397e6bc354f1ad2a223198cc56973de6c1409aa4e31bfe90fd7064037c3",
    4. "created": "2021-08-19T02:53:31.854085322Z",
    5. "compressed-diff-digest": "sha256:afa1907fa2c432a560d72538932a583f39d83efc22874b93996437a986e3bef3",
    6. "compressed-size": 767,
    7. "diff-digest": "sha256:b62b08bf1f2c95a698f60294b87558ed4b700e8e0a0eac037623f986d55d9278",
    8. "diff-size": 4096,
    9. "compression": 2,
    10. "uidset": [
    11. 0
    12. ],
    13. "gidset": [
    14. 0
    15. ]
    16. },
    17. {
    18. "id": "a3e9bebf7bd6361b1dd92ecf6f2b77c0ece19a4ddcb73198df0a97f1a1af7578",
    19. "parent": "ed42d543fba087bf0262c7c2c0a37d2ced7d6410afcf9e43ed648904b9e4c94e",
    20. "created": "2021-08-19T02:53:41.907387302Z",
    21. "compressed-diff-digest": "sha256:5105d5ae3df1768750d351f890511fe751dea205b6e89a6d0cacd0efd8a08b2f",
    22. "compressed-size": 75776,
    23. "diff-digest": "sha256:5105d5ae3df1768750d351f890511fe751dea205b6e89a6d0cacd0efd8a08b2f",
    24. "diff-size": 75776,
    25. "uidset": [
    26. 0
    27. ],
    28. "gidset": [
    29. 0
    30. ]
    31. },
    32. {
    33. "id": "fb0a6af74b7c351d8a960405076ce6001f427b9081f38b932f575b041abd89c4",
    34. "parent": "bf2f9f80a90ab5a5a78ee6a4486498f383c5438a6c85e69784d1b5aa526506bc",
    35. "created": "2021-08-19T02:53:35.899785835Z",
    36. "compressed-diff-digest": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
    37. "compressed-size": 1024,
    38. "diff-digest": "sha256:5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef",
    39. "diff-size": 1024
    40. }]