Last active
February 13, 2017 23:14
-
-
Save PurpleBooth/4a8dd1c0a055dea9e47e736c9220b44f to your computer and use it in GitHub Desktop.
I am on a system with docker but without PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
if [ ! -d "$HOME/.composer" ]; then | |
mkdir "$HOME/.composer" | |
touch "$HOME/.composer/.lastpull" | |
fi | |
if test find "$HOME/.composer/" -name ".lastpull" -and -mtime +7 > /dev/null 2>&1 ; then | |
docker pull composer | |
touch "$HOME/.composer/.lastpull" | |
fi | |
docker run \ | |
-t \ | |
--net host \ | |
--interactive \ | |
--rm \ | |
--user "$(id -u):$(id -g)" \ | |
--volume /etc/passwd:/etc/passwd:ro \ | |
--volume /etc/group:/etc/group:ro \ | |
--volume "$HOME/.ssh:/app/.ssh" \ | |
--volume "$(pwd):/app" \ | |
--volume "$SSH_AUTH_SOCK:/ssh-auth.sock" \ | |
--volume "$HOME/.composer:/composer" \ | |
--env SSH_AUTH_SOCK=/ssh-auth.sock \ | |
composer "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment