docker / cli

The Docker CLI
Apache License 2.0
4.91k stars 1.93k forks source link

Replica not working as before in multiple Compose files #3317

Open leesei opened 3 years ago

leesei commented 3 years ago

Description

I've been using multiple Compose files to suppress some services and run it locally in dev environment .

Steps to reproduce the issue:

  1. docker stack deploy -c stack.yaml -c stack.dev.yaml test

https://gist.github.com/leesei/aaa22b2ea191c2ef313096622359c7e9

Describe the results you received:

2 instances of caddy service, 2 instances of mongo service

Describe the results you expected:

0 instances of caddy service, 2 instances of mongo service

Additional information you deem important (e.g. issue happens only occasionally):

It used to work before. In recent release (maybe a month or so) this was not working anymore. It works if I remove the replica setting in the base stack.yaml but I intended it to be my production config. I would like to see if this is the expected behavior, that the base yaml should not contain replica setting.

Output of docker version:

Client:
 Version:           20.10.8
 API version:       1.41
 Go version:        go1.16.6
 Git commit:        3967b7d28e
 Built:             Wed Aug  4 10:59:01 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.7
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.4
  Git commit:       b0f5bc36fe
  Built:            Fri Jun  4 08:14:24 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.5.2
  GitCommit:        36cc874494a56a253cd181a1a685b44b58a2e34a.m
 runc:
  Version:          1.0.1
  GitCommit:        v1.0.1-0-g4144b638
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Build with BuildKit (Docker Inc., v0.6.1-docker)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 32
 Server Version: 20.10.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
  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: active
  NodeID: hgu2bdliejhoaftel9e2x9u96
  Is Manager: true
  ClusterID: gaphvwyuvw21fqiv8jndm2u3u
  Managers: 1
  Nodes: 1
  Default Address Pool: 10.0.0.0/8  
  SubnetSize: 24
  Data Path Port: 4789
  Orchestration:
   Task History Retention Limit: 5
  Raft:
   Snapshot Interval: 10000
   Number of Old Snapshots to Retain: 0
   Heartbeat Tick: 1
   Election Tick: 3
  Dispatcher:
   Heartbeat Period: 5 seconds
  CA Configuration:
   Expiry Duration: 3 months
   Force Rotate: 0
  Autolock Managers: false
  Root Rotation In Progress: false
  Node Address: 10.6.64.48
  Manager Addresses:
   10.6.64.48:2377
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 36cc874494a56a253cd181a1a685b44b58a2e34a.m
 runc version: v1.0.1-0-g4144b638
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.12.9-arch1-1
 Operating System: Antergos Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 31.23GiB
 Name: kylee-arch
 ID: FEMU:DA7A:ZSTT:TKA5:ZQNQ:672W:ZL6Q:DIRC:OXH4:LQVY:KAXR:DT72
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: leesei
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

Arch on physical machine, everything up to date.

leesei commented 3 years ago

Originally reported as https://github.com/moby/moby/issues/42786 @thaJeztah helped analyze the issue in https://github.com/moby/moby/issues/42786#issuecomment-927746141