Skip to content

[v0.34] buildx bake fails with "cache_to must be a array" when cache_to is an empty [] #3849

Description

@rushikeshmagar492

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

When using docker buildx bake with a Compose file where cache_to is explicitly defined as an empty array ([]), the build fails with a schema validation error.

Buildx version: 0.34.0

Expected behaviour

The bake process should treat cache_to: [] as a valid instruction to not export any cache, or ignore the empty list, and proceed with the build.

Actual behaviour

ERROR: services.test-buildx.build.cache_to must be a array

Buildx version

github.com/docker/buildx v0.34.0 3e73561

Docker info

Client: Docker Engine - Community
 Version:    29.4.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.34.0
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v5.1.3
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Builders list

NAME/NODE       DRIVER/ENDPOINT   STATUS    BUILDKIT   PLATFORMS
default*        docker                                 
 \_ default      \_ default       running   v0.29.0    linux/amd64 (+3)

Configuration

Steps to Reproduce

  1. Install buildx version 0.34.0

  2. Create a docker-compose.yml with cache_to []:
    e.g.
    services:
    test-buildx:
    build:
    context: .
    cache_from:
    - type=registry,ref=.dkr.ecr.us-east-1.amazonaws.com/app-cache:arm64
    cache_to: []

  3. Run the bake command:
    docker buildx bake --load test-buildx

ERROR: services.test-buildx.build.cache_to must be a array

Build logs


Additional info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions