Answer the question
In order to leave comments, you need to log in
How to run "composer require" inside docker by adding ssh-key?
in the php container, I first run
docker-compose exec php php composer.phar install
to install symfony and everything that is written in composer.json and all dependencies are loaded normally
, then I have a private repository in composer.json, but when I do
docker-compose exec php php composer.phar require my/private
then there is no ssh key and ssh too and can't load it
how to do it?
Answer the question
In order to leave comments, you need to log in
Try mounting the key (and ssh.config, if desired) into the container.
If the command php composer.phar install
is executed on behalf of root
inside the container, then the following lines should be in `docker-compose.yml`:
version: '2'
services:
php:
...
volumes:
...
- /path/to/my.key:/root/.ssh/repo.key:ro
...
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question