Skip to content

Instantly share code, notes, and snippets.

@leolana
Created July 16, 2017 14:18
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 leolana/52bc6531b1a59ccd8e85e727e99f110c to your computer and use it in GitHub Desktop.
Save leolana/52bc6531b1a59ccd8e85e727e99f110c to your computer and use it in GitHub Desktop.
Composer script run docker
#!/bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
echo "Current working directory: '"$(pwd)"'"
tty=tty -s && tty=--tty
sudo docker run \
$tty \
--interactive \
--rm \
--user $(id -u):$(id -g) \
--volume /etc/passwd:/etc/passwd:ro \
--volume /etc/group:/etc/group:ro \
--volume $(pwd):/app \
composer "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment