Skip to content

Instantly share code, notes, and snippets.

@partikus
Created January 9, 2022 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save partikus/b31b8ebc52754b9df83368754a30eb27 to your computer and use it in GitHub Desktop.
Save partikus/b31b8ebc52754b9df83368754a30eb27 to your computer and use it in GitHub Desktop.
docker tips & tricks

Docker Tips & Tricks

Running composer through docker container sharing SSH Auth, users, cache dir etc.

docker run -it --rm \
  --env COMPOSER_HOME \
  --env SSH_AUTH_SOCK=/ssh-auth.sock \
  --user $UID:$GID \
  --volume $SSH_AUTH_SOCK:/ssh-auth.sock \
  --volume /etc/passwd:/etc/passwd:ro \
  --volume /etc/group:/etc/group:ro \
  --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp \
  --volume $PWD:/app \
  -w /app \
  composer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment