Skip to content

[BUG] restart ${service} always restart all services #10337

@trim21

Description

@trim21

Description


trim21@omv ~/dockers/test $ docker-compose restart app1
[+] Running 2/2
 ✔ Container test-app2-1  Started                                                    0.7s
 ✔ Container test-app1-1  Started                                                    0.7s

I'm expecting only restart app1 like previous docker-compose version

Steps To Reproduce

version: "3.9"

services:
  app1:
    image: mccutchen/go-httpbin


  app2:
    image: mccutchen/go-httpbin
docker-compose up -d
docker-compose restart app1

expecting to not restart app2

Compose Version

Docker Compose version v2.17.0-rc.1-6-ga99a0b50

Docker Environment

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  v2.16.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 27
  Running: 22
  Paused: 0
  Stopped: 5
 Images: 78
 Server Version: 23.0.1
 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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.3-0-g6724737f
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.0.0-0.deb11.6-amd64
 Operating System: Debian GNU/Linux 11 (bullseye)
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 15.47GiB
 Name: omv
 ID: OQ5M:EOJP:GPNK:FFXP:G6UX:MYHF:RYHZ:TGC2:RLCC:DK43:UGJ7:LVAY
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions