01/06/2019 - DOCKER, PHP
We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.
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.