Docker BuildX 图像未显示在 docker 图像 ls 中
Docker BuildX image not showing in docker image ls
我目前正在尝试使用 BuildKit/BuildX 构建多平台映像(x86_64、arm64、armv7、armv6),它似乎构建成功,但我似乎无法找到图像所在的位置。它没有显示从我以前的 x86_64 构建中更改,并且当尝试 docker 将它推送 到我的 repo 时,它说所有层都已经存在,并且只有一个平台存在。我用来构建图像的命令是:
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 ./
构建后我从终端获得的最后一行是:
=> 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
镜像直接推送到注册表:
=> => pushing manifest for docker.io/frostedflakez/php-mysql-webserver:php-latest-7.4 12.0s
无法将 multi-platform 图像推送到 docker 引擎。相反,引擎中的所有图像都是单一平台,您将 multi-platform 图像直接推送到选定的注册表。您可以拉取图像以获取适合您平台的版本:
docker image pull frostedflakez/php-mysql-webserver:php-latest-7.4
图像本身位于构建器缓存中,但无法从引擎访问。您可以通过以下方式查看缓存大小:
docker system df
您可以使用以下方法清理此缓存:
docker builder prune
我目前正在尝试使用 BuildKit/BuildX 构建多平台映像(x86_64、arm64、armv7、armv6),它似乎构建成功,但我似乎无法找到图像所在的位置。它没有显示从我以前的 x86_64 构建中更改,并且当尝试 docker 将它推送 到我的 repo 时,它说所有层都已经存在,并且只有一个平台存在。我用来构建图像的命令是:
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 ./
构建后我从终端获得的最后一行是:
=> 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
镜像直接推送到注册表:
=> => pushing manifest for docker.io/frostedflakez/php-mysql-webserver:php-latest-7.4 12.0s
无法将 multi-platform 图像推送到 docker 引擎。相反,引擎中的所有图像都是单一平台,您将 multi-platform 图像直接推送到选定的注册表。您可以拉取图像以获取适合您平台的版本:
docker image pull frostedflakez/php-mysql-webserver:php-latest-7.4
图像本身位于构建器缓存中,但无法从引擎访问。您可以通过以下方式查看缓存大小:
docker system df
您可以使用以下方法清理此缓存:
docker builder prune