buildx icon indicating copy to clipboard operation
buildx copied to clipboard

default value is not honoured for `tar` and `compression` while using `docker buildx build`

Open akhilerm opened this issue 11 months ago • 0 comments

Contributing guidelines

I've found a bug and checked that ...

  • [X] ... the documentation does not mention anything about my problem
  • [X] ... there are no open or closed issues that are related to my problem

Description

When using docker buildx buildx --output "type=docker[,parameter]" . to build an image save it as tar file, the default values for compression and tar are not used.

Command used:

akhil@akhil-ThinkPad-L14:~/W/d/docker $ docker buildx build --output "type=docker,tar,compression" -t akhilerm/ubuntu:22.04-custom .
ERROR: invalid value tar

But as per the documentation here, both tar has a default value of true and compression defualts to gzip

Expected behaviour

akhil@akhil-ThinkPad-L14:~/W/d/docker $ docker buildx build --output "type=docker,tar,compression" -t akhilerm/ubuntu:22.04-custom .

Should trigger the build by using default values of tar and compression as gzip

Actual behaviour

akhil@akhil-ThinkPad-L14:~/W/d/docker $ docker buildx build --output "type=docker,tar,compression" -t akhilerm/ubuntu:22.04-custom .
ERROR: invalid value tar

Buildx version

Using buildx from master branch

Docker info

akhil@akhil-ThinkPad-L14:~/W/d/docker $ docker info
Client: Docker Engine - Community
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 2
  Running: 1
  Paused: 0
  Stopped: 1
 Images: 18
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 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: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-97-generic
 Operating System: Ubuntu 22.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 23.47GiB
 Name: akhil-ThinkPad-L14
 ID: d16fc93b-9f2e-4dfa-b5e5-7adeb5cf5dea
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: akhil
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false


### Builders list

```text
akhil@akhil-ThinkPad-L14:~/W/d/docker $  docker buildx ls
NAME/NODE      DRIVER/ENDPOINT             STATUS  BUILDKIT PLATFORMS
sleepy_wing *  docker-container                             
  sleepy_wing0 unix:///var/run/docker.sock running v0.12.5  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386
default        docker                                       
  default      default                     running v0.12.5  linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386

Configuration

FROM ubuntu:latest

RUN apt-get update -y

Build logs

No response

Additional info

The flags for output are parsed here. But default values are not considered while parsing.

akhilerm avatar Mar 07 '24 08:03 akhilerm