-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] build --push
does not push when building for a single platform using a docker-container builder instance
#11072
Comments
Same thing is happening with Compose 2.22.0 |
No change with Compose 2.23.0 (Docker 24.0.7, Buildx 0.11.2). |
Tested with latest codebase, can't reproduce:
I wonder this was fixed as we updated buildx version bundled by Docker Compose. |
Still no luck 😞 $ docker compose version
Docker Compose version 2.23.3
$ cat compose.yaml
services:
test:
build: .
image: ghcr.io/[…]/test
$ docker compose build test --push
[+] Building 0.3s (4/4) FINISHED docker-container:lucid_easley
=> [test internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [test internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 135B 0.0s
=> [test] exporting to docker image format 0.1s
=> => exporting layers 0.0s
=> => exporting manifest sha256:94cb73ac9f02afbbb8bef54381135f6e7d219ca38b6ef5a02f79d7c567ad9b93 0.0s
=> => exporting config sha256:734400a254924dbeafa357043ff90435990700d710c4ba011b180bea2d6a674e 0.0s
=> => sending tarball 0.0s
=> [test] importing to docker Only difference seems to be the container registry 🤔 |
weird. Using ghcr (while I'm not logged in) I still get a push attempt:
Can you please check the active builder by running |
Sure, thanks for your time 🙏 $ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
lucid_easley * docker-container
lucid_easley0 unix:///var/run/docker.sock stopped
default docker
default default running v0.11.7+d3e6c1360f6e linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6 I recall docker compose not wanting to use Edit: after trying to
|
I was able to reproduce this issue when using a docker-container builder instance, while |
build --push
does not push when building for a single platformbuild --push
does not push when building for a single platform using a docker-container builder instance
I confirm that switching back to the |
the root cause for this issue is that buildkit doesn't allow to configure multiple exporters. When using the default builder (implemented by docker engine) the Also see moby/buildkit#1555 |
Why would Compose not respect |
this is not compose, but buildkit API. Only one "exporter" can be configured to move the built result to out from builder. Can be either a registry ("push") or Docker engine local image cache ("load"). When using the "default" builder (implemented by docker engine) "load" is not required as image is built inside local image cache, so "push" export image to registry in addition to the image being present in local cache. When using an alternative builder (docker-container, or cloud-based) we have no way to configure both exporter, until moby/buildkit#1555 allows to do |
Thanks for the explanation, I understand now! Should I close this issue as it provides a workaround (using the default |
let's indeed close this issue, as there's anyway nothing we can do until upstream offers a way to workaround this limitation |
@ndeloof thanks for providing explanations! However, I still don't really understand. In my compose file I have few services, each has a build section, with a |
@guyarad it uses the same buildkit builder in both case, but the build parameters differ as multi-platform is enabled. In such circumstances the builder won't handle the |
@ndeloof thanks for the quick response. I'm still a little confused though. Why would build parameters be different? who is passing those build parameters? |
yes indeed, |
Is it possible to see the actual parameters being passed to buildkit via |
@ndeloof I’m not sure, but did moby/buildkit#4134 unlock this issue? |
Description
I have a
fpm
service in acompose.yaml
file which configures bothbuild
andimage
. The idea is that someone can build the image and push it to GHCR and other people just have to pull it.In the
build
section, I hadlinux/amd64
andlinux/arm64
underplatforms
. Thendocker compose build --push fpm
ends withAs this took some time I dropped
platforms
, but thendocker compose build --push fpm
ended withThe behavior is the same if I configure a single platform, be it
linux/amd64
(mine) orlinux/arm64
.docker compose push fpm
always work though.Steps To Reproduce
I’m not sure what is the cause, but in my case having a single platform under a service’s
build
section is enough to preventdocker compose build --push
to push the image.Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: