-
Notifications
You must be signed in to change notification settings - Fork 120
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
Unable to build multi-platform builds #7507
Comments
The base images here just use Gitlab's dependency proxy, and the images are just replicas of the same image without the I've just tred running without the
I've tried |
Correction. I'd stripped too much out. Having changed So here's a command without the dependency proxy, although most of these build args are used later in the file but are in because the Dockerfile contains them at the top… docker buildx build \
--target api_platform_php \
--platform linux/amd64,linux/arm64 \
--cache-to type=inline \
--build-arg BASE_COMPOSER_IMAGE=composer:latest \
--build-arg BASE_PHP_IMAGE=php:7.4-fpm-alpine \
--build-arg BASE_OPENRESTY_IMAGE=openresty/openresty:1.17.8.2-alpine \
--build-arg BASE_SSH_IMAGE=alpine:3 \
--build-arg BASE_MONGODB_IMAGE=mongo:4.4 \
--build-arg BASE_VARNISH_IMAGE=varnish:6.4 \
--build-arg CACHE_BUST_RANDOM_KEY=6760a880a147e5.83688969 \
--tag good-technologies/crm/api/php:dev \
--progress=plain \
--secret id=php-secrets,src=.secrets/php/.secrets . … and here's the one that works, without the platform/cache-to args… docker buildx build \
--target api_platform_php \
--build-arg BASE_COMPOSER_IMAGE=composer:latest \
--build-arg BASE_PHP_IMAGE=php:7.4-fpm-alpine \
--build-arg BASE_OPENRESTY_IMAGE=openresty/openresty:1.17.8.2-alpine \
--build-arg BASE_SSH_IMAGE=alpine:3 \
--build-arg BASE_MONGODB_IMAGE=mongo:4.4 \
--build-arg BASE_VARNISH_IMAGE=varnish:6.4 \
--build-arg CACHE_BUST_RANDOM_KEY=6760a880a147e5.83688969 \
--tag good-technologies/crm/api/php:dev \
--progress=plain \
--secret id=php-secrets,src=.secrets/php/.secrets . |
I created a repo to demo the problem… |
Description
On various PHP based projects I'm unable to build container images for non-
linux/arm64
platforms. Every time I do it seems to result in a different compile error.I've tried using the default builder context with containerd storage on, as well as using a custom build context, but with the same problems either way.
The point at which it fails appears to be inconsistent.
Reproduce
docker buildx build \ --target api_platform_php \ --cache-to type=inline \ --platform linux/amd64,linux/arm64 \ --build-arg BASE_COMPOSER_IMAGE=gitlab.com/good-technologies/dependency_proxy/containers/composer:latest \ --build-arg BASE_PHP_IMAGE=gitlab.com/good-technologies/dependency_proxy/containers/php:7.4-fpm-alpine \ --build-arg BASE_OPENRESTY_IMAGE=gitlab.com/good-technologies/dependency_proxy/containers/openresty/openresty:1.17.8.2-alpine \ --build-arg BASE_SSH_IMAGE=gitlab.com/good-technologies/dependency_proxy/containers/alpine:3 \ --build-arg BASE_MONGODB_IMAGE=gitlab.com/good-technologies/dependency_proxy/containers/mongo:4.4 \ --build-arg BASE_VARNISH_IMAGE=gitlab.com/good-technologies/dependency_proxy/containers/varnish:6.4 \ --build-arg CACHE_BUST_RANDOM_KEY=6760a880a147e5.83688969 \ --tag good-technologies/crm/api/php:dev \ --progress=plain \ --secret id=php-secrets,src=.secrets/php/.secrets .
And here's the resulting log…
Expected behavior
The image should build successfully.
If I remove the
--platform
&--cache-to
i can then use the standard build context, without containerd enabled, and it builds fine.docker version
Client: Docker Engine - Community Version: 27.3.1 API version: 1.45 (downgraded from 1.47) Go version: go1.23.1 Git commit: ce1223035a Built: Fri Sep 20 11:01:47 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.31.0 (153195) Engine: Version: 26.1.4 API version: 1.45 (minimum version 1.24) Go version: go1.21.11 Git commit: de5c9cf Built: Wed Jun 5 11:29:12 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.33 GitCommit: d2d58213f83a351ca8f528a95fbd145f5654e957 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
CED5B7F6-7A03-4A91-BD9D-8E75B357F576/20241216223749
Additional Info
No response
The text was updated successfully, but these errors were encountered: