Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
docker stack deploy from private repo

Does anyone know how to specify username / password for pulling images from a private registry during a docker stack deploy? I want to be able to do this in one command:

docker stack deploy --compose-file docker-compose.yml --username <user> --password <pass> mystack

Without this, I first have to do a

docker login -u <user> -p <pass> <registry-url>

Can this be done in one command?

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

This worked for me, I had a private repo on dockerhub

docker login -u <<UserName>> -p <<Password>>
registry.hub.docker.com/<<Repo_Name>>
&& docker stack deploy -c docker-swarm.yml mystack --with-registry-auth

The key is to pass Username Password along with registry name and then followed it up with this flag --with-registry-auth

Here is the link which provides step by step information.

about 4 years ago · Santiago Trujillo Report

0

I think it cannot do it in one command typically, but you can configure private registry for clients with specific ip without authentication if you insist.

Or you can just do it in different commands but one line:

$ docker login -u <user> -p <pass> <registry-url> && docker stack deploy --compose-file docker-compose.yml mystack
about 4 years ago · Santiago Trujillo Report

0

The issue Use SSH pub key in order to allow access to a repository #531 address the ability to connect to an repository using SSH and keys. It's a best way to mantain security and privacity.

But you can create a read only user to perform that. If you automate the process, you can recreate de user, or change password, by the way, you can choose any turn around to solve that.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!