expand documentation

describe how to overcome non-existant user errors that git might throw
when combining the custom user and private repositories scenarios
This commit is contained in:
Rob Bast 2017-02-07 11:20:22 +01:00
parent a24895493d
commit fb47cb75d0
No known key found for this signature in database
GPG Key ID: 73076E35E6165F39
1 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,19 @@ docker run --rm --interactive --tty \
composer install composer install
``` ```
When combining the use of private repositories with running Composer as another (local) user, you might run into non-existant user errors. To work around this, simply mount the host passwd and group files (read-only) into the container:
```sh
docker run --rm --interactive --tty \
--volume $PWD:/app \
--volume $SSH_AUTH_SOCK:/ssh-auth.sock \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--user $(id -u):$(id -g) \
--env SSH_AUTH_SOCK=/ssh-auth.sock \
composer install
```
## Suggestions ## Suggestions
### PHP Extensions ### PHP Extensions
@ -75,6 +88,8 @@ composer () {
--interactive \ --interactive \
--rm \ --rm \
--user $(id -u):$(id -g) \ --user $(id -u):$(id -g) \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume $(pwd):/app \ --volume $(pwd):/app \
composer "$@" composer "$@"
} }