Skip to content

[Bake] Inconsistency between --set and HCL for target platform(s) #2870

@milas

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

In HCL:

target foo {
  platforms = ["linux/arm64", "linux/amd64"]
}

Documented as target.platforms (plural) @ https://docs.docker.com/build/bake/reference/#targetplatforms

On CLI:

docker buildx bake --set='foo.platform=linux/arm64,linux/amd64'

Documented as {target}.platform (singular) @ https://docs.docker.com/reference/cli/docker/buildx/bake/#set

Expected behaviour

Either platform or platforms should be used consistently throughout or both should be accepted interchangably

Actual behaviour

HCL uses platforms while CLI uses platform

Buildx version

github.com/docker/buildx v0.19.3 Homebrew

Docker info

Client: Docker Engine - Community
 Version:    27.4.0
 Context:    colima
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.3
    Path:     /opt/homebrew/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.32.1
    Path:     /opt/homebrew/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 27
  Running: 12
  Paused: 0
  Stopped: 15
 Images: 21
 Server Version: 27.3.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc version: v1.1.14-0-g2c9f560
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.8.0-47-generic
 Operating System: Ubuntu 24.04.1 LTS
 OSType: linux
 Architecture: aarch64
 CPUs: 6
 Total Memory: 15.58GiB
 Name: colima
 ID: b51536c7-a886-44f6-99cd-752a2b9bd2c3
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 100
  Goroutines: 216
  System Time: 2024-12-18T11:01:23.461160393-05:00
  EventsListeners: 0
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Builders list

NAME/NODE    DRIVER/ENDPOINT   STATUS    BUILDKIT   PLATFORMS
colima*      docker                                 
 \_ colima    \_ colima        running   v0.16.0    linux/arm64
default                        error

Configuration

See description for examples

Build logs

ERROR: unknown key: platforms

Additional info

No response

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions