contraint instead of label to create Registry on node1 (#4644)

As the `--label` option is used before in `docker node update --label-add registry=true node1`, the Docker registry should be restricted to only run on `node1` - and nowhere else. So the `docker service create` command has to use the option `--constraint 'node.labels.registry==true` instead of `--label registry=true`- because it is a contraint, where to run the Registry - we don´t just want to set a label again.
This commit is contained in:
Jonas Hecht 2017-09-15 20:20:26 +02:00 committed by Misty Stanley-Jones
parent 8b93c50982
commit 1f640d19dd

View file

@ -318,7 +318,7 @@ $ docker service create \
--name registry \ --name registry \
--secret domain.crt \ --secret domain.crt \
--secret domain.key \ --secret domain.key \
--label registry=true \ --constraint 'node.labels.registry==true' \
--mount src=/mnt/registry,dst=/var/lib/registry \ --mount src=/mnt/registry,dst=/var/lib/registry \
-e REGISTRY_HTTP_ADDR=0.0.0.0:80 \ -e REGISTRY_HTTP_ADDR=0.0.0.0:80 \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/domain.crt \ -e REGISTRY_HTTP_TLS_CERTIFICATE=/run/secrets/domain.crt \