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
 Context:    default
 Debug Mode: false
  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)

 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
  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:
   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
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Experimental: false
 Insecure Registries:
 Live Restore Enabled: false
1 Like