Closed bennythejudge closed 5 years ago
When I tried my theory, the apache container would not start. Could you please explain this? This is clearly not an issue other than my lack of understanding/knowledge.
If you run composer as www-data user inside apache container, you need to link your auth file on your host to the www-data home folder
./yourhostauthjson.json:/var/www/.composer/auth.json
It kept having errors so I just commented out the file from the docker composer config.
ERROR: for apache Cannot start service apache: error while creating mount source path '/host_mnt/c/Users/megab/.composer/auth.json': mkdir /host_mnt/c/Users/megab/.composer: permission denied
ERROR: Encountered errors while bringing up the project.
The permission denied thing, I needed to goto advanced security on the folder I was trying to use as a volume and give the docker-user group write access. (Windows Docker).
But then I still needed a login to run composer update
in the end
I changed it to use ./
rather than ~/
and made an auth.json with the login for my Magento2 keys.
Phew~
Generate key here: https://marketplace.magento.com/customer/accessKeys/
{
"http-basic": {
"repo.magento.com": {
"username": "Your Public Key",
"password": "Your Private Key"
}
}
}
Guide: https://devdocs.magento.com/guides/v2.2/install-gde/prereq/connect-auth.html
Hello everybody, the mount can be configured in many different ways (or removed completely), it really depends on how you want to use it.
I wanted to mount only the auth.json but you could mount the whole .composer directory, for the root user or the www-data user, it really depends on how you want to use it.
In this line in the
docker-compose.yml
file,should:
be
and
~/.composer
on the host contain aauth.json
file (content according to this page?