Home > Enterprise >  Executing docker login in docker-compose file
Executing docker login in docker-compose file

Time:02-02

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?

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

Thanks for your help.

CodePudding user response:

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.

  •  Tags:  
  • Related