How do I create a service using an image from a private registry?

0 votes
I have an image in a private registry,I wish to create a service from this image and deploy the service to docker-swarm. What's the way to achieve this?
Jul 8 in Docker by Ruby
22 views

1 answer to this question.

0 votes

Hey @Ruby, 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:

$ 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.

This will do!

answered Jul 8 by Sirajul
• 30,940 points

Related Questions In Docker

0 votes
1 answer

What is a docker file? How do I create a docker image with dockerfile?

 A Dockerfile is a script/text configuration file that contains ...READ MORE

answered Jun 7 in Docker by Sirajul
• 30,940 points
345 views
0 votes
2 answers

How do I start a container and create a volume using a volume driver?

You can first create the volume and ...READ MORE

answered Aug 6 in Docker by Sirajul
• 30,940 points
29 views
0 votes
1 answer

How do I copy a file from docker container to host?

Here is a way which you can ...READ MORE

answered Aug 27, 2018 in Docker by Damon Salvatore
• 5,510 points
3,195 views
0 votes
1 answer

How do I remove an image in Docker?

Here is what you can try. Use docker ...READ MORE

answered Sep 4, 2018 in Docker by Damon Salvatore
• 5,510 points
45 views
0 votes
1 answer
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
1,023 views
0 votes
1 answer

how do I create an image from a tar archive in docker?

You can use docker load command inorder to get ...READ MORE

answered Jul 2 in Docker by Sirajul
• 30,940 points
63 views
0 votes
2 answers

How do I force Docker for a clean build of an image ?

You could try this inorder to clean ...READ MORE

answered Aug 6 in Docker by Sirajul
• 30,940 points
1,352 views