Skip to content

Make --compatibility flag implicit - #7226

Closed
aiordache wants to merge 2 commits into
docker:masterfrom
aiordache:compose_compatibility_flag
Closed

aiordache wants to merge 2 commits into
docker:masterfrom
aiordache:compose_compatibility_flag

Conversation

@aiordache

@aiordache aiordache commented Feb 11, 2020 •

Copy link
Copy Markdown
Contributor

We don't need to pass the compatibility argument anymore to parse the 'deploy' section of the config.
Using the --compatibility flag will not raise an exception but it will be ignored.

$ cat docker-compose.yaml 
version: "3"
services:
  test:
    image: nginx
    deploy:
      mode: replicated
      replicas: 3

BEFORE
Only one container per service is created.

$ docker-compose up -d
WARNING: Some services (test) use the 'deploy' key, which will be ignored. Compose does not support 'deploy' configuration - use `docker stack deploy` to deploy to a swarm.
Creating network "schema_default" with the default driver
Creating schema_test_1 ... done

--compatibility arg should be passed to get the deploy field parsed

$ docker-compose --compatibility up -d
Creating network "schema_default" with the default driver
Creating schema_test_1 ... done
Creating schema_test_2 ... done
Creating schema_test_3 ... done

NOW
The number of containers to be created is set by the replicas field in the deploy section

$ docker-compose up -d
Creating network "schema_default" with the default driver
Creating schema_test_1 ... done
Creating schema_test_2 ... done
Creating schema_test_3 ... done
$ docker ps 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES
b60359965485        nginx               "nginx -g 'daemon of…"   2 minutes ago       Up 2 minutes        80/tcp              schema_test_1
dfd513b7a273        nginx               "nginx -g 'daemon of…"   2 minutes ago       Up 2 minutes        80/tcp              schema_test_2
62ca6291bc17        nginx               "nginx -g 'daemon of…"   2 minutes ago       Up 2 minutes        80/tcp              schema_test_3
$ docker-compose down
Stopping schema_test_1 ... done
Stopping schema_test_2 ... done
Stopping schema_test_3 ... done
Removing schema_test_1 ... done
Removing schema_test_2 ... done
Removing schema_test_3 ... done
Removing network schema_default

Signed-off-by: Anca Iordache anca.iordache@docker.com
Resolves https://github.com/docker/dev-tooling-team/issues/121

@chris-crone chris-crone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Anca Iordache <anca.iordache@docker.com>
@aiordache
aiordache force-pushed the compose_compatibility_flag branch from 8268387 to b6b85e4 Compare February 12, 2020 19:17
Signed-off-by: Anca Iordache <anca.iordache@docker.com>
@silvin-lubecki

Copy link
Copy Markdown
Contributor

@aiordache can you rebase your PR? 🙏

@silvin-lubecki

Copy link
Copy Markdown
Contributor

@ulyssessouza PTAL 🦁

@silvin-lubecki

Copy link
Copy Markdown
Contributor

@aiordache it looks like there are some test failures?

@aiordache

Copy link
Copy Markdown
Contributor Author

Closing PR as #7588 covered this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants