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

docker buildx prune require 3x CTRL-C to cancel #2240

Closed
3 tasks done
thaJeztah opened this issue Feb 4, 2024 · 1 comment · Fixed by #2289
Closed
3 tasks done

docker buildx prune require 3x CTRL-C to cancel #2240

thaJeztah opened this issue Feb 4, 2024 · 1 comment · Fixed by #2289

Comments

@thaJeztah
Copy link
Member

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

This looks to be an oversights, and might be a "fun one" to work around; we want plugins to have the opportunity to do a graceful shutdown (CTRL-C to let the plugin to finish work before terminating), it looks like there's some exceptions to this rule.

❓ I noticed this on the docker buildx prune / docker builder prune, and I think this handling is specific to buildx, soo perhaps that's the only case this happens, but maybe other plugins have the same handling;

Expected behaviour

I'd expect the command to be cancelled.

For comparison, running other prune commands will terminate immediately when pressing CTRL-C;

$ docker volume prune
WARNING! This will remove anonymous local volumes not used by at least one container.
Are you sure you want to continue? [y/N] ^C
$

Actual behaviour

The command does not cancel when pressing CTRL-C, requiring me to CTRL-C 3 times to forcefully terminate;

$ docker buildx prune
WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N] ^C^C^CERROR: got 3 SIGTERM/SIGINTs, forcing shutdown
$

Also verified the same happens without the "compose-cli" wrapper;

$ com.docker.cli buildx prune
WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N] ^C^C^CERROR: got 3 SIGTERM/SIGINTs, forcing shutdown

Note that pressing N (don't prune) does work as expected, and terminates the CLI (and plugin);

$ docker buildx prune
WARNING! This will remove all dangling build cache. Are you sure you want to continue? [y/N] N

Buildx version

github.com/docker/buildx v0.12.1-desktop.4 6996841df2f61988c2794d84d33205368f96c317

Docker info

docker info
Client:
 Version:    25.0.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1-desktop.4
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.3-desktop.1
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container. (Docker Inc.)
    Version:  0.0.22
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-debug
  desktop: Commands to interact with Docker Desktop (Docker Inc.)
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.22
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.0.0
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.3.0
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-scout
  shell: Open a browser shell on the Docker Host. (thaJeztah)
    Version:  v0.0.1
    Path:     /Users/thajeztah/.docker/cli-plugins/docker-shell
WARNING: Plugin "/Users/thajeztah/.docker/cli-plugins/docker-scan" is not valid: failed to fetch metadata: fork/exec /Users/thajeztah/.docker/cli-plugins/docker-scan: no such file or directory

Server:
 Containers: 3
  Running: 1
  Paused: 0
  Stopped: 2
 Images: 31
 Server Version: 25.0.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: a1496014c916f9e62104b33d1bb5bd03b0858e59
 runc version: v1.1.11-0-g4bccb38
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.13-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.658GiB
 Name: docker-desktop
 ID: 58815d06-8744-4af3-b6f1-7a88003318ad
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 52
  Goroutines: 98
  System Time: 2024-02-04T11:23:12.997011638Z
  EventsListeners: 14
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  host.docker.internal:5002
  hubproxy.docker.internal:5555
  host.docker.internal:5001
  127.0.0.0/8
 Live Restore Enabled: false

Builders list

not relevant

Configuration

not relevant

Build logs

No response

Additional info

No response

@thaJeztah
Copy link
Member Author

cc @crazy-max @laurazard 😄

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

Successfully merging a pull request may close this issue.

1 participant