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
Add before_script
Then
script
Adjust this to suit best for you.
I pulled both.
diff can help you.
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).
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
fromarm64
isfd4d966f65ddc0ac1727570766563e2f9d0dd8e2557234d179a017e244e67979
So you can pull this image by running:But it looks like the
oraclelinux
has another repository to storearm64
images, so maybe you can run:Does it work for you?