Search code examples
dockerdocker-buildkitdocker-cli

Docker BuildX image not showing in docker image ls


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

Solution

  • 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