Compose: docker-compose up does not ignore replicas

Created on 9 Sep 2020  路  1Comment  路  Source: docker/compose

Description of the issue

Running docker-compose up does not ignore the replicas option, even though the documentation says it should.

Context information (for bug reports)

Output of docker-compose version

docker-compose version 1.27.0, build unknown

Output of docker version

Docker version 19.03.12-ce, build 48a66213fe

Output of docker-compose config

services:
  app:
    deploy:
      replicas: 5
    image: hello-world
version: '3'

Steps to reproduce the issue

  1. Copy the compose file below into some directory, e.g. compose-bug
version: "3"

services:
  app:
    image: hello-world
    deploy:
      replicas: 5
  1. Run docker-compose up

Observed result

Five containers are started:

Creating network "compose-bug_default" with the default driver
Creating compose-bug_app_1 ... done
Creating compose-bug_app_2 ... done
Creating compose-bug_app_3 ... done
Creating compose-bug_app_4 ... done
Creating compose-bug_app_5 ... done
Attaching to compose-bug_app_1, compose-bug_app_3, compose-bug_app_5, compose-bug_app_2, compose-bug_app_4
...

Expected result

Only one container should be started.

Additional information

Output of uname -s -r -v -o (kernel-name/release/version and operating system):

Linux 5.8.7-arch1-1 #1 SMP PREEMPT Sat, 05 Sep 2020 12:31:32 +0000 GNU/Linux

Docker and docker-compose is installed from Arch Linux's offical repositories.

kinbug

Most helpful comment

Hello @MTBorg, thanks for the report. Actually that's normal, since we've removed the compatibility flag.
Actually that's a "documentation" issue. We will update that ASAP. This is included in the merge of 2.x and 3.x compose formats.

>All comments

Hello @MTBorg, thanks for the report. Actually that's normal, since we've removed the compatibility flag.
Actually that's a "documentation" issue. We will update that ASAP. This is included in the merge of 2.x and 3.x compose formats.

Was this page helpful?
0 / 5 - 0 ratings