skip to Main Content

I wanted to download docker images of oraclelinux for amd64 and arm64 architectures. But both are showing same sha256 digest. Why is that?

docker pull --platform=linux/amd64 oraclelinux:7-slim
Trying to pull repository docker.io/library/oraclelinux ...
7-slim: Pulling from docker.io/library/oraclelinux
Digest: sha256:7a46c0134e2cad2d15a98eac50c89f9e0f4640c0461b838672d41ea0710d75c5
Status: Downloaded newer image for oraclelinux:7-slim
oraclelinux:7-slim
docker pull --platform=linux/arm64 oraclelinux:7-slim
Trying to pull repository docker.io/library/oraclelinux ...
7-slim: Pulling from docker.io/library/oraclelinux
Digest: sha256:7a46c0134e2cad2d15a98eac50c89f9e0f4640c0461b838672d41ea0710d75c5
Status: Downloaded newer image for oraclelinux:7-slim
oraclelinux:7-slim

I wanted to use both separately in Gitlab CI-CD as mentioned in How to specify image platform in gitlab-ci.yml .
How can I do this?

3

Answers


  1. Add before_script

    • export IMAGE_NAME
    • export IMAGE_TAG

    Then
    script

    • docker pull $IMAGE_NAME:$IMAGE_TAG

    Adjust this to suit best for you.

    I pulled both.
    diff can help you.

    diff <(docker inspect 6b9fd09833be) <(docker inspect 554de8d676bd)
    
    Login or Signup to reply.
  2. The digest listed by docker is the manifest list. It will be dereferenced to the platform specific manifest as the image is pulled, but docker lists the manifest list for portability (the same digest can be used other multiple platforms).

    $ regctl manifest get oraclelinux:7-slim
    Name:        oraclelinux:7-slim
    MediaType:   application/vnd.docker.distribution.manifest.list.v2+json
    Digest:      sha256:7a46c0134e2cad2d15a98eac50c89f9e0f4640c0461b838672d41ea0710d75c5
                 
    Manifests:   
                 
      Name:      docker.io/library/oraclelinux:7-slim@sha256:eccab04a8a5299ea5ae6cc51ad697aa01012ff2732c999360c4d218dd9451440
      Digest:    sha256:eccab04a8a5299ea5ae6cc51ad697aa01012ff2732c999360c4d218dd9451440
      MediaType: application/vnd.docker.distribution.manifest.v2+json
      Platform:  linux/amd64
                 
      Name:      docker.io/library/oraclelinux:7-slim@sha256:fd4d966f65ddc0ac1727570766563e2f9d0dd8e2557234d179a017e244e67979
      Digest:    sha256:fd4d966f65ddc0ac1727570766563e2f9d0dd8e2557234d179a017e244e67979
      MediaType: application/vnd.docker.distribution.manifest.v2+json
      Platform:  linux/arm64
    
    Login or Signup to reply.
  3. As mentioned by @BMitch this sha256 is from the manifest list, which contains all architectures.

    Since multi architecture/platform tags of a Docker image have different digests, You can pull a Docker image using its digest (instead of using tags) to pull the desired architecture/platform.

    As we can see in oraclelinux — The sha256 from arm64 is fd4d966f65ddc0ac1727570766563e2f9d0dd8e2557234d179a017e244e67979 So you can pull this image by running:

    $ docker pull oraclelinux@sha256:fd4d966f65ddc0ac1727570766563e2f9d0dd8e2557234d179a017e244e67979 
    

    But it looks like the oraclelinux has another repository to store arm64 images, so maybe you can run:

    $ docker pull oraclelinux:7-slim
    $ docker pull arm64v8/oraclelinux:7-slim
    

    Does it work for you?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search