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
15 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
• 5,960 points

Related Questions In Docker

0 votes
1 answer

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

You can try the following step: You have ...READ MORE

answered Sep 7, 2018 in Docker by Damon Salvatore
• 5,490 points
560 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,490 points
1,455 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,490 points
35 views
0 votes
1 answer

How do I run a docker image as a container?

You can run an image depends on whether you ...READ MORE

answered Sep 7, 2018 in Docker by Damon Salvatore
• 5,490 points
54 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
952 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
• 5,960 points
16 views
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
• 5,960 points
249 views