Skip to content

No error when adding index annotations using docker exporter and docker driver #2605

Open
@dvdksn

Description

@dvdksn

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

Building an image with the docker builder, while also trying to add annotations to index, doesn't result in an error.

Expected behaviour

When trying to build an image with annotations on index, using a docker-container builder, my build fails as expected if I try to use the docker exporter.

$ docker buildx b --builder container --annotation "index:foo=bar" --output type=docker .
...
 => ERROR exporting to docker image format                                                     0.0s
 => => exporting layers                                                                        0.0s
------
 > exporting to docker image format:
------
ERROR: failed to build: failed to solve: index annotations not supported for single platform export

Actual behaviour

$ docker buildx b --builder desktop-linux --annotation "index:foo=bar" .
[+] Building 1.2s (9/9) FINISHED                                               docker:desktop-linux
...
 => exporting to image                                                                         0.0s
 => => exporting layers                                                                        0.0s
 => => writing image sha256:a10a6248e2608c811b279aab218200dfe92795a7724c40616574edb30df6c1fc   0.0s

Buildx version

github.com/docker/buildx 3005743 3005743

Docker info

No response

Builders list

NAME/NODE              DRIVER/ENDPOINT     STATUS    BUILDKIT   PLATFORMS
container*             docker-container                         
 \_ container0          \_ desktop-linux   running   v0.14.1    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
default                docker                                   
 \_ default             \_ default         running   v0.14.1    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
desktop-linux          docker                                   
 \_ desktop-linux       \_ desktop-linux   running   v0.14.1    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
cloud-docker-default   cloud               error

Configuration

$ docker buildx b --builder desktop-linux --output type=docker --annotation "index:foo=bar" -<<< "FROM alpine"

Build logs

No response

Additional info

No response

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions