Docker Community Forums

Share and learn in the Docker community.

IntelliJ exited but containers started by docker-compose from IntelliJ's Terminal still be running

I am using IntelliJ IDEA’s internal Terminal tab,
from it, I ran

docker-compose up --force-recreate --abort-on-container-exit --remove-orphans

Then containers get running up.

However, I accidentally closed IntelliJ IDEA, and found the containers are still running there.

Is this the expected behavior? or is there any way to prevent this? (I want containers being killed once I close IntelliJ).

I suspect that once docker-compose spawn up the containers, it enters to a log receiver status, in this state, kill it does not affect the running containers, am I right?

BTW, this is my docker info

$__ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  scan: Docker Scan (Docker Inc., v0.5.0)

Server:
 Containers: 24
  Running: 0
  Paused: 0
  Stopped: 24
 Images: 11
 Server Version: 20.10.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 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: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 4.19.121-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 1.942GiB
 Name: docker-desktop
 ID: LJIB:TSC3:EUUB:BGJF:Y2VI:OURX:Y7B7:4QJ6:X5TC:H6MF:IW3I:JWYX
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
1 Like