01/06/2019 - DOCKER, PHP
If you are getting message below while trying to install private repositories with composer and want to avoid manual interaction, you can use this example.
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+clone-php+2019-05-31+2137
to retrieve a token. It will be stored in "/root/.composer/auth.json" for future use by Composer.
You can omit "Token" and "Environment" steps below if you have previously completed both steps for any other projects.
Assume that this is your composer.json file.
"no-api": true #This is not compulsory
Run command below on local PC.
Add entry below to docker-compose.yaml file as an environmental variable.
If you run composer instal/update/require commands, you should not be asked to enter token.