From fb47cb75d03030c7e412b252a8748cb8b4899c7c Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Tue, 7 Feb 2017 11:20:22 +0100 Subject: [PATCH] expand documentation describe how to overcome non-existant user errors that git might throw when combining the custom user and private repositories scenarios --- composer/content.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/composer/content.md b/composer/content.md index 0fbde0c35..0df807198 100644 --- a/composer/content.md +++ b/composer/content.md @@ -44,6 +44,19 @@ docker run --rm --interactive --tty \ 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 ### PHP Extensions @@ -75,6 +88,8 @@ composer () { --interactive \ --rm \ --user $(id -u):$(id -g) \ + --volume /etc/passwd:/etc/passwd:ro \ + --volume /etc/group:/etc/group:ro \ --volume $(pwd):/app \ composer "$@" }