when i change the arch type, but the sha256 value is not change. and then i find out if i download it with command: docker pull xxx:latest ,the images size is 2x than the real image size.
and this options seem to have some trouble.
$ docker pull freelabspace/postgresql-postgis:16.9 --platform=arm64
00668167bf36: Pull complete
510e0bc6d455: Pull complete
0fb10b4d1840: Pull complete
40458a09dd0a: Pull complete
05792ac6ba34: Pull complete
e2c75e46b83f: Pull complete
98943dfcad11: Pull complete
b6882eaa56b0: Pull complete
df734c93257b: Pull complete
ba6e34516748: Pull complete
Digest: sha256:e79918ef780293b6c36cb4a5a2554703a52b92f2fe22174fb001512a90d9a51c
Status: Downloaded newer image for freelabspace/postgresql-postgis:16.9
docker.io/freelabspace/postgresql-postgis:16.9
$ docker pull freelabspace/postgresql-postgis:16.9@sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54
docker.io/freelabspace/postgresql-postgis@sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54: Pulling from freelabspace/postgresql-postgis
Digest: sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54
Status: Downloaded newer image for freelabspace/postgresql-postgis@sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54
docker.io/freelabspace/postgresql-postgis:16.9@sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54
$ docker save freelabspace/postgresql-postgis:16.9 | gzip > postgresql-postgis-v16.9-arm64.tar.gz
Error response from daemon: unable to create manifests file: NotFound: content digest sha256:24aa4dcf459423c8f82f298d50f859be70c60ef1959d776dbf6ff4b79b56d023: not found
$ docker tag freelabspace/postgresql-postgis:16.9@sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54 freelabspace/postgresql-postgis:16.9
$ docker save freelabspace/postgresql-postgis:16.9 | gzip > postgresql-postgis-v16.9-arm64.tar.gz
Can you share step by step what you expected and what happened instead?
How did you tested it? The image size you see on Docker is the compressed size and it is extracted when you pull it. If you are using the containerd image store, then containerd also keeps the compressed version.
After pulling the image I see the correct size.
209M -rw-rw-r-- 1 ta ta 209M máj 27 12:34 postgresql-postgis-v16.9.tar.gz
and
66M -rw-rw-r-- 1 ta ta 66M máj 27 12:42 postgresql-backup.tar.gz
Then, re-label to create the image offline normally.
$ docker tag freelabspace/postgresql-postgis:16.9@sha256:d277b3d06e3f1446b93d723ce0c86531742eda1b203e756a8939fa0fa7305f54 freelabspace/postgresql-postgis:16.9
$ docker save freelabspace/postgresql-postgis:16.9 | gzip > postgresql-postgis-v16.9-arm64.tar.gz
Also, as mentioned earlier, when I use the default pull xxx:latest, the downloaded image is twice as large as the normal image. My local environment is x86, but this docker-desktop is displayed as arm64, and the arm64 image is the one I downloaded before.
Oh, I see. I’m actually not sure how it worked before, because I only had to save single-platfom images and all were amd64 images, but it is true, that Docker v28 introduced the --platform option for more subcommands, including the docker save command.
Quote:
docker load, docker save, and docker history now support a --platform flag allowing you to choose a specific platform for single-platform operations on multi-platform images. docker/cli#5331
So I guess now you have to use docker save --platform=arm64. I wasn’t aware of it, but it could be another step towards real multi-platform images to avoid confusion when you had to use the platform option for one command and not for the other, so the same command could do different things (before) depending on what command was executed before it.
What do you mean by subcommands? I compared it with the previous v24 version and found nothing new.
#################### debian12 system ######################
$ docker version
Client: Docker Engine - Community
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:08:17 2023
OS/Arch: linux/amd64
Context: default
Server: Docker Engine - Community
Engine:
Version: 24.0.7
API version: 1.43 (minimum version 1.12)
Go version: go1.20.10
Git commit: 311b9ff
Built: Thu Oct 26 09:08:17 2023
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.6.25
GitCommit: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
runc:
Version: 1.1.10
GitCommit: v1.1.10-0-g18a0cb0
docker-init:
Version: 0.19.0
GitCommit: de40ad0
$ docker pull --help
Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Download an image from a registry
Aliases:
docker image pull, docker pull
Options:
-a, --all-tags Download all tagged images in the repository
--disable-content-trust Skip image verification (default true)
--platform string Set platform if server is multi-platform capable
-q, --quiet Suppress verbose output
#################### win10 system ######################
PS C:\Users\Devops> docker version
Client:
Version: 28.1.1
API version: 1.49
Go version: go1.23.8
Git commit: 4eba377
Built: Fri Apr 18 09:53:24 2025
OS/Arch: windows/amd64
Context: desktop-linux
Server: Docker Desktop 4.41.2 (191736)
Engine:
Version: 28.1.1
API version: 1.49 (minimum version 1.24)
Go version: go1.23.8
Git commit: 01f442b
Built: Fri Apr 18 09:52:57 2025
OS/Arch: linux/amd64
Experimental: true
containerd:
Version: 1.7.27
GitCommit: 05044ec0a9a75232cad458027ca83437aae3f4da
runc:
Version: 1.2.5
GitCommit: v1.2.5-0-g59923ef
docker-init:
Version: 0.19.0
GitCommit: de40ad0
PS C:\Users\Devops> docker pull --help
Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Download an image from a registry
Aliases:
docker image pull, docker pull
Options:
-a, --all-tags Download all tagged images in the repository
--disable-content-trust Skip image verification (default true)
--platform string Set platform if server is multi-platform
capable
-q, --quiet Suppress verbose output
I hope these issues can be fixed:
First: --platform parameter can normally obtain the image of the relevant architecture, and then it can be used normally, such as running or exporting.
Second: In the official Dockerhub repository, when switching between different architecture images, the displayed sha256 id should be different, and should not be handled manually.
The third problem is that docker-desktop cannot refresh the update page display information in time. It is clearly an amd64 architecture image, but it is displayed as an arm64 architecture image.
I’m not sure why you wouldn’t test the only subcommand I was writing about. “docker save”
Have you tried it? Since docker save now has the platform option, you probably need to use it.
I don’t know what the whole output is or what your command was that returned it. Please, don’t upload screenshots of texts. Share the whole output as a code block (as you did witth the other outputs) and also the exact command you ran to get the output. The docker image inspect command returns the right architecture to me.
What do you mean? The index ID will not change, only the manifest digest and that changes on Docker Hub. The index ID points to the whole multi-platform image.
$ docker save freelabspace/postgresql-postgis:16.9 --platform=arm64 | gzip > pg.tar.gz
Error response from daemon: no suitable export target found: image with referenc
e freelabspace/postgresql-postgis:16.9 was found but does not provide the specif
ied platform (windows/arm64)
$ docker save freelabspace/postgresql-postgis:16.9 --platform=arm64 | gzip > pg.tar.gz
Error response from daemon: no suitable export target found: image with reference freelabspace/postgresql-postgis:16.9 was found but does not provide the
specified platform (windows/arm64)
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
freelabspace/nacos-backup latest fa3073a4b92f 4 days ago 529MB
freelabspace/postgresql-postgis 16.9 13ce6d95eadf 11 days ago 899MB
$ docker inspect freelabspace/postgresql-postgis:16.9 | grep -i architecture
"Architecture": "arm64",
It looks like you are on Windows and Docker wants to save an image for windows/arm64 which does not exist and you want Linux container images. Use linux/arm64 instead of just the CPU architecture.