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

[BUG] Not all attached containers are stopped on CTRL + C #10120

Closed
sidz opened this issue Dec 22, 2022 · 2 comments
Closed

[BUG] Not all attached containers are stopped on CTRL + C #10120

sidz opened this issue Dec 22, 2022 · 2 comments

Comments

@sidz
Copy link

sidz commented Dec 22, 2022

Description

Compose doesn't stop attached containers on CTRL + C.

Steps To Reproduce

  1. Define 3 services in the docker-compose.yaml with depends_on key. (example below)
  2. Up only php container with --attach-dependencies eg. docker compose up php --attach-dependencies (not in daemon mode)
  3. Click on Ctrl + C
  4. Docker stops only php container but others are still in the running state
version: "3.4"

services:
    php:
        image: php:8.1.12-fpm-alpine3.16
        depends_on:
            - mailhog

    memcache:
        image: memcached:1.6-alpine
        restart: on-failure

    mailhog:
        image: mailhog/mailhog
        ports:
            - "127.0.0.1:8025:8025"

Compose Version

Docker Compose version v2.14.2

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc., v2.14.2)

Server:
 Containers: 19
  Running: 0
  Paused: 0
  Stopped: 19
 Images: 38
 Server Version: 20.10.12
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 
 runc version: 
 init version: 
 Security Options:
  apparmor
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.15.0-56-generic
 Operating System: Ubuntu 22.04.1 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 23.41GiB
 Name: sid
 ID: 6F76:W6AV:4SUL:T4LA:ESVC:WGOU:WF4D:6TCP:O2SY:HF55:BH5J:II2H
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

@sidz
Copy link
Author

sidz commented Jan 2, 2023

Just for reference: #10021 wasn't fully fixed in PR #10029

@ndeloof
Copy link
Contributor

ndeloof commented Nov 28, 2023

This is the expected behavior:
As you run up with --attach-dependencies flag, compose ensure dependencies are running and attach to them, but still the services you targeted are the only ones considered to be stopped by SIGINT. --attach-dependencies purpose, as the name suggest, is to attach logs, not to add service dependencies in the list of managed services

@ndeloof ndeloof closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants