Skip to content

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

Closed
compose-spec/compose-go
#873

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

  1. tonistiigi commented on May 14, 2026

    @tonistiigi
    Member

    @jsternberg Is this coming from compose or from us?

  2. rushikeshmagar492 commented on May 14, 2026

    @rushikeshmagar492
    Author

    I believe its docker buildx, since there is no change in compose version and it is working fine with buildx version v0.33.0 f7897eb

  3. changed the title [-]buildx bake fails with "cache_to must be a array" when cache_to is an empty [][/-] [+][v0.34] buildx bake fails with "cache_to must be a array" when cache_to is an empty [][/+] on May 14, 2026
  4. added this to the v0.34.1 milestone on May 14, 2026
  5. tonistiigi commented on May 15, 2026

    @tonistiigi
    Member
    8a01076b6749d5e3c1fc363c8d4e8196f9493037 is the first bad commit
    commit 8a01076b6749d5e3c1fc363c8d4e8196f9493037
    Author: Guillaume Lours <glours@users.noreply.github.com>
    Date:   Fri Apr 3 12:15:27 2026 +0200
    
        bump compose-go to version v2.10.2
        
        Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
    
    

    #3775

    compose bisect

    dabd353441f599227cb3ec240113af6c1fa648ca is the first bad commit
    commit dabd353441f599227cb3ec240113af6c1fa648ca
    Author: Nicolas De Loof <nicolas.deloof@gmail.com>
    Date:   Thu Nov 6 12:31:01 2025 +0100
    
        create_host_path must not be omitted when set to false
        
        Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
    
    

    compose-spec/compose-go#836

    https://github.com/compose-spec/compose-go/pull/836/changes#diff-eafe62eae191e88faad4c223c4de9af268c175ee68695872e175b814d7c5baa5R74 looks like candidate.

    @glours @ndeloof

  6. tonistiigi commented on May 15, 2026

    @tonistiigi
    Member

    possible workaround without need to update compose #3852

  7. added a commit that references this issue on May 18, 2026
    c9079e9
  8. added 2 commits that reference this issue on May 18, 2026
    89a1d6a
    13c0c15
  9. thaJeztah commented on May 18, 2026

    @thaJeztah
    Member

    Probably shouldn't be closed yet until vendored

  10. tonistiigi commented on May 19, 2026

    @tonistiigi
    Member
  11. removed this from the v0.34.1 milestone on May 19, 2026
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