3

I am currently trying to build a multi-platform image (x86_64, arm64, armv7, armv6) using BuildKit/BuildX, and it seems to build successfully, but I can't seem to find where the image is located. It doesn't show up changed from my previous build for x86_64, and when trying to docker push it to my repo, it says that all the layers already exist, and only one platform is present. The command that I used to build the image is:

docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 -m 5120M --no-cache --progress auto --pull -t frostedflakez/php-mysql-webserver:php-latest-7.4 --push ./

The last lines I get from the terminal after building is:

 => exporting to image                                                                                                                                                     264.6s
 => => exporting layers                                                                                                                                                     46.1s
 => => exporting manifest sha256:585ca6c82887a6f0178007c905f11c7fbde5e6220b9c451892c40d2844b43403                                                                            0.0s
 => => exporting config sha256:0923c92918eb6fad44396000250f11946f38f6e1eb0d78ec916a794f395f526a                                                                              0.0s
 => => exporting manifest sha256:0b9fceb5f74bca71942ce3e1aa5fdf5ed0453e16aff53bec5d22a9c15233fbc2                                                                            0.0s
 => => exporting config sha256:ba19e5dab51b74549775cfbc1b0ce3961342a2c859050d98e68b6130ee276e91                                                                              0.0s
 => => exporting manifest sha256:540ef45e6b3cfec74af6a4c641b70009587b19b1fe5702338a9b93b409136b28                                                                            0.0s
 => => exporting config sha256:7be378e1831fa4bd00f1595bf4d511286c600d21ee245db567115fb85fdd24cc                                                                              0.0s
 => => exporting manifest sha256:9a339a6283db4ffe56c735d85306e87261aebe8a7f696984da67720f24d4ab73                                                                            0.0s
 => => exporting config sha256:e54fc6d23c38d1a119ba6781b868643d2ede87a8f5fe0e55a5874b140fbe235e                                                                              0.0s
 => => exporting manifest list sha256:d4ec48c69d17df29e5f8521a2ede6dd83cadc8868d2829621fd15dc0582916c2                                                                       0.0s
 => => pushing layers                                                                                                                                                      206.3s
 => => pushing manifest for docker.io/frostedflakez/php-mysql-webserver:php-latest-7.4                                                                                      12.0s
NotAnerd
  • 145
  • 1
  • 10

1 Answers1

2

The image is pushed directly to the registry:

 => => pushing manifest for docker.io/frostedflakez/php-mysql-webserver:php-latest-7.4       12.0s

It's not possible to push a multi-platform image to a docker engine. Instead all images in the engine are single platform, and you push the multi-platform image directly to the selected registry. You can pull the image to get the version for your platform:

docker image pull frostedflakez/php-mysql-webserver:php-latest-7.4

The image itself is in the builder cache, but that's not accessible from the engine. You can view that cache size with:

docker system df

And you can clean this cache with:

docker builder prune
BMitch
  • 148,146
  • 27
  • 334
  • 317
  • Does this mean that the image in docker hub will work with the other platforms I have selected, but they will show up as single-platform? There is no build cache for me. – NotAnerd Oct 17 '20 at 15:08
  • @NotAnerd If you created a container builder you may not see the cache. Looking at your repo right now I'm not seeing the manifest list, and the image itself doesn't appear to be built with buildkit, so you may have overwritten it or failed the push. – BMitch Oct 17 '20 at 15:25
  • I used ```docker buildx build``` to build the image. I am trying to rebuild it again, but it seems to somehow find another image that was already built with it, even when I pruned it. I am using the ```--no-cache``` option to build it, will that affect the manifests? Building the multi-arch example seemed to work fine as far multi-platform manifests are concerned. – NotAnerd Oct 17 '20 at 15:44
  • @NotAnerd You'd create a new image with a new manifest if you build without the cache. If you're running this and the image isn't getting pushed to Docker Hub, then there may be other errors in the command you're running that we cannot see in your question. – BMitch Oct 17 '20 at 16:39
  • it gets pushed to docker hub, but still stays as *linux/amd64* – NotAnerd Oct 17 '20 at 22:56