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, 2019 in Docker by Ruby
737 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, 2019 by Sirajul
• 59,230 points

Related Questions In Docker

+1 vote
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, 2019 in Docker by Sirajul
• 59,230 points
4,019 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, 2019 in Docker by Sirajul
• 59,230 points
1,258 views
0 votes
1 answer
+1 vote
2 answers

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

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

answered Aug 28, 2018 in Docker by Damon Salvatore
• 5,980 points
28,197 views
+2 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
3,158 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, 2019 in Docker by Sirajul
• 59,230 points
7,996 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, 2019 in Docker by Sirajul
• 59,230 points
10,261 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP