Skip to content

WCOW: Multiple issues with artifact output  #2555

@cpuguy83

Description

@cpuguy83

Test setutp

# Dockerfile
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

Testing this using docker buildx build --output=type=docker,dest=/path/to/export.tar -< Dockerfile

Issues

  • struct fields are being reordered
  • os.version field is being stripped from manifest list entries as well as from the image config
  • urls field is missing
  • Foreign layers are being marked as normal layers

Real data from mcr registry

index

Details
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 574,
      "digest": "sha256:718e295fd449212ffd928189ee1e3c62893faf1cd1a2b0b345394ec234362f65",
      "platform": {
        "architecture": "amd64",
        "os": "windows",
        "os.version": "10.0.20348.469"
      }
    }
  ]
}

manifest

Details
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 406,
    "digest": "sha256:f2b4df67e05043a8a88e30cc31a0006a3aedcd76a4ea031ac29baf67d37a6346"
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip",
      "size": 117334348,
      "digest": "sha256:b2bb136f79c12b0a42720d7bb83469bce3f7bf2ca5c8bc68a36228796311fc6b",
      "urls": [
        "https://mcr.microsoft.com/v2/windows/nanoserver/blobs/sha256:b2bb136f79c12b0a42720d7bb83469bce3f7bf2ca5c8bc68a36228796311fc6b"
      ]
    }
  ]
}

config

Details
{
  "architecture": "amd64",
  "os": "windows",
  "os.version": "10.0.20348.469",
  "created": "2022-01-06T03:34:42.4676822+00:00",
  "history": [
    {
      "created": "2022-01-06T03:34:42.4676822+00:00",
      "created_by": "Apply image ltsc2022-amd64"
    }
  ],
  "rootfs": {
    "type": "layers",
    "diff_ids": [
      "sha256:22fd5883bda971d71824447522829114747c1a2b9f446648a3d8e6f291aadbe0"
    ]
  },
  "config": {
    "user": "ContainerUser",
    "cmd": [
      "c:\\windows\\system32\\cmd.exe"
    ]
  }
}

data output by buildkit

index

Details
{
  "schemaVersion": 2,
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:7e00800a3a0301a0a091dde2c9b3090119d48804d6ea9cecf1d2a5f27c498055",
      "size": 529,
      "annotations": {
        "org.opencontainers.image.created": "2022-01-11T18:37:00Z"
      }
    }
  ]
}

manifest

Details
{
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "schemaVersion": 2,
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "digest": "sha256:150a59cf86898055400a9e430a0b1b316cc9776e2063498dc030bdb77fde21cc",
    "size": 430
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "digest": "sha256:b2bb136f79c12b0a42720d7bb83469bce3f7bf2ca5c8bc68a36228796311fc6b",
      "size": 117334348
    }
  ]
}

config

Details
{
  "architecture": "amd64",
  "config": {
    "User": "ContainerUser",
    "Env": [
      "PATH=c:\\Windows\\System32;c:\\Windows"
    ],
    "Cmd": [
      "c:\\windows\\system32\\cmd.exe"
    ],
    "OnBuild": null
  },
  "created": "2022-01-06T03:34:42.4676822Z",
  "history": [
    {
      "created": "2022-01-06T03:34:42.4676822Z",
      "created_by": "Apply image ltsc2022-amd64"
    }
  ],
  "os": "windows",
  "rootfs": {
    "type": "layers",
    "diff_ids": [
      "sha256:22fd5883bda971d71824447522829114747c1a2b9f446648a3d8e6f291aadbe0"
    ]
  }
}

Note: I piped all data through jq for easier reading

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions