Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Executing docker login in docker-compose file

I am relatively new to docker and have a docker-compose file where I want to access a private repository.

Since the docker-compose file will also run on other computers, I would like to integrate the docker login command into the docker-compose file.
So that docker-compose up is executed and then as with docker login the user data must be entered.

Is this possible at all?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Unfortunately in my search so far I have not found a way to integrate the command.

Thanks for your help.

>Solution :

No; there’s no way to specify repository credentials in a docker-compose.yml file. (And you definitely would not want to commit them to source control or distribute them in a plain-text file even if it were possible.) You need to manually run docker login on each system.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading