docker / docker/buildx

Tags are missing when using buildx with multiarch builds

Open
#3,163 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status/needs-investigation status/triage
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

Contributing guidelines
I've found a bug and checked that ...
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem
Description

docker 28.1.1, buildx 0.23.0

I have been using:

docker buildx build --pull --push --platform linux/arm64,linux/amd64 -t xxx.ecr.aws/project:1.0 -t xxx.ecr.aws/project:latest -t user/project:1.0 -t user/project:test project

My system was using qemu to emulate arm64 on an amd64 system. On my upgrade to use ubuntu 24.04 as a base image, it was noticed the arm64 optimizations where extreemly slow using qemu, so I moved to a native arm64 build using the docker buildx remote features.

NAME/NODE  DRIVER/ENDPOINT             STATUS  PLATFORMS
builder *  docker-container                    
  builder0 unix:///var/run/docker.sock running linux/amd64/v2*, linux/amd64*, linux/386*, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/arm/v7, linux/arm/v6
  builder1 awsarm                      running linux/arm64*, linux/arm/v7*, linux/arm/v6*
awsarm     docker                              
  awsarm   awsarm                      running linux/arm64, linux/arm/v7, linux/arm/v6

This works well, and builds much faster.
But after I switched to this, I have noticed only the first tag (buildx -t) is used, and none of the other tags get applied to new builds.

In order to work around this, I have had to do a separate buildx run for each -t to get it all push with the tags, and this is adding considerable delay.

Though the buildx logs appear to say it tagged the image in the repo, the repo does not contain the tags.

Expected behaviour

when using the -t flag, that tag, evert -t should be applied to the image, it seems it only happens for the first one if you have multiple builders.

Actual behaviour

only the first tag is applied when you have several builder machines.

Buildx version

0.23.0

Docker info
Client: Docker Engine - Community
 Version:    28.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc.)
    Path:     /root/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.35.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 8
  Running: 1
  Paused: 0
  Stopped: 7
 Images: 46
 Server Version: 28.1.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 05044ec0a9a75232cad458027ca83437aae3f4da
 runc version: v1.2.5-0-g59923ef
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-58-generic
 Operating System: Ubuntu 24.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 23.42GiB
 Name: builder01
 ID: DZUR:5Z5A:3ZQD:D643:N6JQ:5EIX:PYRM:I4GO:JTHZ:XSAF:YVXX:EGNV
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: patrickdk
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
Builders list
NAME/NODE  DRIVER/ENDPOINT             STATUS  PLATFORMS
builder *  docker-container                    
  builder0 unix:///var/run/docker.sock running linux/amd64/v2*, linux/amd64*, linux/386*, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/arm/v7, linux/arm/v6
  builder1 awsarm                      running linux/arm64*, linux/arm/v7*, linux/arm/v6*
awsarm     docker                              
  awsarm   awsarm                      running linux/arm64, linux/arm/v7, linux/arm/v6
default    docker                              
  default  default                     running linux/amd64, linux/amd64/v2, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
Configuration

FROM ubuntu:latest

Build logs
Building project
[+] Building 322.6s (20/20) FINISHED                                                                                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                0.0s
 => => transferring dockerfile: 13.26kB                                                                                                                                                                                                                             0.0s
 => [linux/amd64 internal] load metadata for docker.io/library/ubuntu:24.04                                                                                                                                                                                         0.7s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                0.2s
 => => transferring dockerfile: 13.26kB                                                                                                                                                                                                                             0.2s
 => [linux/arm64 internal] load metadata for docker.io/library/ubuntu:24.04                                                                                                                                                                                         0.2s
 => [internal] load .dockerignore                                                                                                                                                                                                                                   0.2s
 => => transferring context: 45B                                                                                                                                                                                                                                    0.2s
 => [internal] load .dockerignore                                                                                                                                                                                                                                   0.0s
 => => transferring context: 45B                                                                                                                                                                                                                                    0.0s
 => CACHED [linux/amd64 stage-0 1/3] FROM docker.io/library/ubuntu:24.04@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02                                                                                                                    0.0s
 => => resolve docker.io/library/ubuntu:24.04@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02                                                                                                                                               0.0s
 => [internal] load build context                                                                                                                                                                                                                                   0.0s
 => => transferring context: 17.28kB                                                                                                                                                                                                                                0.0s
 => [linux/amd64 stage-0 2/3] RUN  --mount=type=cache,id=apt-cache-24.04-amd64,sharing=locked,target=/var/cache/apt  --mount=type=cache,id=apt-lib-24.04-amd64,sharing=locked,target=/var/lib/apt  --mount=type=bind,source="rootfs",target=/rootfs  --mount=typ  246.5s
 => CACHED [linux/arm64 stage-0 1/3] FROM docker.io/library/ubuntu:24.04@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02                                                                                                                    0.0s
 => => resolve docker.io/library/ubuntu:24.04@sha256:1e622c5f073b4f6bfad6632f2616c7f59ef256e96fe78bf6a595d1dc4376ac02                                                                                                                                               0.0s
 => [internal] load build context                                                                                                                                                                                                                                   0.2s
 => => transferring context: 17.28kB                                                                                                                                                                                                                                0.2s
 => [linux/arm64 stage-0 2/3] RUN  --mount=type=cache,id=apt-cache-24.04-arm64,sharing=locked,target=/var/cache/apt  --mount=type=cache,id=apt-lib-24.04-arm64,sharing=locked,target=/var/lib/apt  --mount=type=bind,source="rootfs",target=/rootfs  --mount=typ  244.7s
 => [linux/arm64 stage-0 3/3] RUN  --mount=type=bind,source="rootfs",target=/rootfs  --mount=type=bind,source="phpext",target=/phpext  set -e  && export LC_ALL=C  && export DEBIAN_FRONTEND=noninteractive  && export INITRD=no  && . /etc/os-release  && arch=$(  2.2s
 => [linux/amd64 stage-0 3/3] RUN  --mount=type=bind,source="rootfs",target=/rootfs  --mount=type=bind,source="phpext",target=/phpext  set -e  && export LC_ALL=C  && export DEBIAN_FRONTEND=noninteractive  && export INITRD=no  && . /etc/os-release  && arch=$(  3.1s
 => exporting to image                                                                                                                                                                                                                                             52.9s
 => => exporting layers                                                                                                                                                                                                                                            37.2s
 => => exporting manifest sha256:b3cd0f3e7b038ebbe6a47a2d5d3c5df453b5dfcd70da5b92242155c39e6f6a38                                                                                                                                                                   0.0s
 => => exporting config sha256:b9981f2224d8b07d38c86df3c6e45d3dbc7a33939f77fc585bfc72dafafa68cd                                                                                                                                                                     0.0s
 => => exporting manifest list sha256:58c6b4c3b5ec2cef6c362f986dc8b3b6b9cb9e0c1446d9ca75de5988db2b2237                                                                                                                                                              0.0s
 => => pushing layers                                                                                                                                                                                                                                               7.2s
 => => pushing manifest for xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/project                                                                                                                                                                                    0.6s 
 => => pushing manifest for docker.io/user/project                                                                                                                                                                                                                  0.8s 
 => exporting to image                                                                                                                                                                                                                                             71.0s
 => => exporting layers                                                                                                                                                                                                                                            50.2s
 => => exporting manifest sha256:b89c062af1a4a19f52b76914667d9b000ef14393b6e0bbde32f18c2f6b854e0e                                                                                                                                                                   0.0s
 => => exporting config sha256:66b89adef891fc907f08bea6ce9bcb76ad16e11e0deaf38a6d0b15b5ec68cfa5                                                                                                                                                                     0.0s
 => => exporting manifest list sha256:38e84eafc0e5e7bed41407171e6954e44beac3316cc909bae7ba5f0987c26e6d                                                                                                                                                              0.0s
 => => pushing layers                                                                                                                                                                                                                                              10.0s
 => => pushing manifest for xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/project                                                                                                                                                                                    0.9s
 => => pushing manifest for docker.io/user/project                                                                                                                                                                                                                  0.9s
 => [auth] sharing credentials for xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com                                                                                                                                                                                     0.0s
 => [auth] user/project:pull,push token for registry-1.docker.io                                                                                                                                                                                                    0.0s
 => [auth] user/project:pull,push token for registry-1.docker.io                                                                                                                                                                                                    0.0s
 => merging manifest list xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/project:1.3.01,xxxxxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/project:latest,user/project:test,user/project:1.3.01,user/project:latest                                                         1.2s
Additional info

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented docker buildx build command with multiple -t values and the listed multi-node builder configuration, then inspect the build and push output. Trace the multi-platform export and tag handling; done means every supplied tag is present in the target registries after one build.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.