From 821452629ce48ca195f8f6564be1ccdc6d39f016 Mon Sep 17 00:00:00 2001 From: Misty Stanley-Jones Date: Wed, 31 Jan 2018 13:19:37 -0800 Subject: [PATCH] Add an example for --with-registry-auth Signed-off-by: Misty Stanley-Jones --- docs/reference/commandline/service_create.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/reference/commandline/service_create.md b/docs/reference/commandline/service_create.md index 8380e831e8..25d0c17c61 100644 --- a/docs/reference/commandline/service_create.md +++ b/docs/reference/commandline/service_create.md @@ -112,6 +112,26 @@ dmu1ept4cxcf redis replicated 1/1 redis:3.0.6 a8q9dasaafud redis2 global 1/1 redis:3.0.6 ``` +#### Create a service using an image on a private registry + +If your image is available on a private registry which requires login, use the +`--with-registry-auth` flag with `docker service create`, after logging in. If +your image is stored on `registry.example.com`, which is a private registry, use +a command like the following: + +```bash +$ docker login registry.example.com + +$ docker service create \ + --with-registry-auth \ + --name my_service \ + registry.example.com/acme/my_image:latest +``` + +This passes the login token from your local client to the swarm nodes where the +service is deployed, using the encrypted WAL logs. With this information, the +nodes are able to log into the registry and pull the image. + ### Create a service with 5 replica tasks (--replicas) Use the `--replicas` flag to set the number of replica tasks for a replicated