Skip to content
New issue

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

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

Already on GitHub? # to your account

Multiarch image creation date and history #308

Closed
nevergone opened this issue May 15, 2023 · 3 comments
Closed

Multiarch image creation date and history #308

nevergone opened this issue May 15, 2023 · 3 comments
Labels

Comments

@nevergone
Copy link

Hi, I use this docker registry UI and I have an issue...

Bug description

I build a multiarch Docker image with folowing command:
docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7 --output=type=image,push=true,registry.insecure=false -t nevergone/test-latest

But image creation date and image history is not available (see attached screenshot). What do I do wrong? The images are created (I tried it) and I can also upload them to Docker Hub.
Thanks!

For service bug, steps to reproduce the behavior:
My docker-compose file

services:
  registry:
    image: registry:2
    ports:
      - 5000:5000
    environment:
      DEBUG: true
      REGISTRY_STORAGE_DELETE_ENABLED: true
      REGISTRY_CATALOG_MAXENTRIES: 100000
    volumes:
      - ./registry-config/simple.yml:/etc/docker/registry/config.yml
      - ./registry:/var/lib/registry/
  ui:
    image: joxit/docker-registry-ui:latest
    ports:
      - 8082:80
    environment:
      REGISTRY_TITLE: Private Docker Registry
      REGISTRY_URL: http://127.0.0.1:5000
      USE_CONTROL_CACHE_HEADER: true
      SINGLE_REGISTRY: true
      DELETE_IMAGES: true
    depends_on:
      - registry
    profiles:
      - ui

My private docker registry configuration

version: 0.1
log:
  fields:
    service: registry
storage:
  delete:
    enabled: true
  cache:
    blobdescriptor: inmemory
  filesystem:
    rootdirectory: /var/lib/registry
http:
  addr: :5000
  headers:
    X-Content-Type-Options: [nosniff]
    Access-Control-Allow-Origin: ['*']
    Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE']
    Access-Control-Allow-Headers: ['Authorization', 'Accept', 'Cache-Control']
    Access-Control-Max-Age: [1728000]
    Access-Control-Allow-Credentials: [true]
    Access-Control-Expose-Headers: ['Docker-Content-Digest']

Screenshots

Screenshot_20230515-091342

System information

  • OS: Ubuntu Linux 22.04
  • Browser:
    • Name: Firefox
    • Version: 113
  • Docker registry UI:
    • Version: 2.4.1
    • Server: Docker
    • Docker version: 23.0.6
    • Docker registry ui tag: latest
    • OS/Arch: linux/amd64
    • Tools: Docker compose
@GoryMoon
Copy link

It's because buildx exports oci index.
To workaround that you can add --provenance=false to your build command.

But I don't see how the registry UI couldn't support this for multiarch builds.
From looking at the API response this is what getting the manifest from a tag returns, e.g. v2/<image name>/manifests/latest:

Click to expand tag manifest
{
    "mediaType": "application/vnd.oci.image.index.v1+json",
    "schemaVersion": 2,
    "manifests": [
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "digest": "sha256:9f38533c3ac11fe5b6d9c08aa5f683887159ecbc01ee65635b2fb3ab6de57ab0",
            "size": 2761,
            "platform": {
                "architecture": "amd64",
                "os": "linux"
            }
        },
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "digest": "sha256:caac61937ce912af68dd7b09ea16be9e15211f7319d800913d19a80b73b4a298",
            "size": 2761,
            "platform": {
                "architecture": "arm64",
                "os": "linux"
            }
        },
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "digest": "sha256:d388def5035290ee739d973cc9e8549e237f423de26dee55ea4949a40d01da65",
            "size": 566,
            "annotations": {
                "vnd.docker.reference.digest": "sha256:9f38533c3ac11fe5b6d9c08aa5f683887159ecbc01ee65635b2fb3ab6de57ab0",
                "vnd.docker.reference.type": "attestation-manifest"
            },
            "platform": {
                "architecture": "unknown",
                "os": "unknown"
            }
        },
        {
            "mediaType": "application/vnd.oci.image.manifest.v1+json",
            "digest": "sha256:6f5e15228ac5ad5dacfbbfc97df6564a9ab1cd0adcdb197b00a627cbe3b7cc51",
            "size": 566,
            "annotations": {
                "vnd.docker.reference.digest": "sha256:caac61937ce912af68dd7b09ea16be9e15211f7319d800913d19a80b73b4a298",
                "vnd.docker.reference.type": "attestation-manifest"
            },
            "platform": {
                "architecture": "unknown",
                "os": "unknown"
            }
        }
    ]
}

When using digest of the previous manifest like when you are using application/vnd.docker.distribution.manifest.list.v2+json to get the actual image here:

const response = JSON.parse(this.responseText);
if (response.mediaType === 'application/vnd.docker.distribution.manifest.list.v2+json' && self.opts.list) {
self.trigger('list', response);
const manifest = response.manifests[0];
const image = new DockerImage(self.name, manifest.digest, { ...self.opts, list: false });
eventTransfer(image, self);
image.fillInfo();
self.variants = [image];
return;
}

As this is the response from the second manifest GET, e.g. v2/<image name>/manifests/sha256:9f38533c3ac11fe5b6d9c08aa5f683887159ecbc01ee65635b2fb3ab6de57ab0:

Click to expand digest manifest
{
    "mediaType": "application/vnd.oci.image.manifest.v1+json",
    "schemaVersion": 2,
    "config": {
        "mediaType": "application/vnd.oci.image.config.v1+json",
        "digest": "sha256:8f2e7c70dac05c95bd5a522cf4a059857fc8c997ad1cdf9e2b3eff9a37fe9c4c",
        "size": 9253
    },
    "layers": [
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:1efc276f4ff952c055dea726cfc96ec6a4fdb8b62d9eed816bd2b788f2860ad7",
            "size": 31366757
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:a2f2f93da48276873890ac821b3c991d53a7e864791aaf82c39b7863c908b93b",
            "size": 1582262
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:12cca292b13cb58fadde25af113ddc4ac3b0c5e39ab3f1290a6ba62ec8237afd",
            "size": 212
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:d73cf48caaac2e45ad76a2a9eb3b311d0e4eb1d804e3d2b9cf075a1fa31e6f92",
            "size": 46042445
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:e832be86182094add78a1690b0fbd8818e40710a53d43171db4b271d43d46158",
            "size": 5484
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:871f7cebf585d387fde9f3fd270668065701606577a1008ed3b3acfac8274cc4",
            "size": 18460921
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:207983e6a84c88158ffa317f4341aa449fe063b44834682569d7b2506c9f2437",
            "size": 859851653
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:1d99b33ce83abb0fd774713bf9dd14c29710d54f969b57056a35f5a9b332054e",
            "size": 179
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:ca5cba012caf700f0fb5ddb9a7904eae14744e4ab44594c1b482ecbad77f8d1b",
            "size": 3057
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:39a7c4fc07c05d4870b4d95a7a0015ab56c4e07e516cf549a54bf3e9fd8ff73a",
            "size": 212
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:401b2e2746eb54009b1f49b321161cfc251c1c8d12444b0eeb463a9b4f1902ea",
            "size": 329
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:4eafb804449bab1cdde11fb488b0a7a1f59f89bf24a530463a1cb91c07eecf8a",
            "size": 5323
        },
        {
            "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
            "digest": "sha256:0f7e12b417c3dbebe0a2ba16556075c1b64823b25ba115c43ec14f494d6c64b4",
            "size": 390
        }
    ]
}

And using that config blob returns the history as the current system expects.

@nevergone
Copy link
Author

Thanks, it's working! :)

@Joxit
Copy link
Owner

Joxit commented May 16, 2023

Hi both of you and thank you for using my project 😄

I glad to see contributors responding to issues 🥰

Big kudos to you @GoryMoon

For the record the message from the UI comes from this issue #227
Checkout the comment with all the explanation : #227 (comment)

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

No branches or pull requests

3 participants