Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in handling of empty lists on command line #2858

Closed
3 tasks done
amarburg opened this issue Dec 13, 2024 · 3 comments · Fixed by #2814
Closed
3 tasks done

Regression in handling of empty lists on command line #2858

amarburg opened this issue Dec 13, 2024 · 3 comments · Fixed by #2814
Labels
area/bake kind/bug Something isn't working
Milestone

Comments

@amarburg
Copy link

amarburg commented Dec 13, 2024

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

Between v0.18.0 and v0.19.2, handling of null-values for keys from the command line changed, breaking existing configurations.

Expected behaviour

We have a docker-bake.yaml which sets the cache-to key:

target "default" {
  cache_to = [
    "type=local,dest=.docker-cache"
  ]
}

In some circumstances (some Github workflow builds, for example) we want to not cache the results. We would do this with:

$ docker buildx bake --set "*.cache-to="

(or the equivalent through the docker/bake-action workflow action).

The expected behavior is:

# Default bakefile
$ docker buildx bake --print

target "default" {
  cache_to = [
    "type=local,dest=.docker-cache"
  ]
}


# Bakefile without cache
$ docker buildx bake --print --set "*.cache="

target "default" {
  cache_to = []
}

Actual behaviour

Actual behavior:

# Bakefile without cache
> docker buildx bake --print --set "*.cache-to="
[+] Building 0.0s (1/1) FINISHED
 => [internal] load local bake definitions                                                                                    0.0s
 => => reading docker-bake.hcl 77B / 77B                                                                                      0.0s
ERROR: EOF

Buildx version

github.com/docker/buildx v0.19.2 1fc5647

Docker info

Client: Docker Engine - Community
 Version:    27.4.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.19.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.31.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Builders list

NAME/NODE                DRIVER/ENDPOINT                   STATUS    BUILDKIT   PLATFORMS
container-builder*       docker-container
 \_ container-builder0    \_ unix:///var/run/docker.sock   running   v0.17.1    linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (4 more)
default                  docker
 \_ default               \_ default                       running   v0.17.3    linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (4 more)

Configuration

FROM alpine
target "default" {
  cache_to = [
    "type=local,dest=.docker-cache"
  ]
}
$ docker buildx bake
$ docker buildx bake --set "*.cache-to="

Build logs


Additional info

No response

@tonistiigi
Copy link
Member

in v0.19 branch this was fixed in #2861

@crazy-max
Copy link
Member

And will be on master with #2814

@briceburg
Copy link

thanks for the report and quick fix all!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bake kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants