Created
February 3, 2019 06:31
-
-
Save spuf/7ebef9f9d2e738d6c10f2c7d739a83b4 to your computer and use it in GitHub Desktop.
Docker image as executable
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
set -euo pipefail | |
if [[ -t 0 ]]; then | |
arg_tty="--tty" | |
else | |
arg_attach="--attach stdin --attach stdout --attach stderr" | |
fi | |
exec docker run -w="$(pwd)" --volume=/tmp/:/tmp/ --volume=$HOME/:$HOME/ --volume=/Volumes/:/Volumes/ --net=host --rm --interactive ${arg_tty-} ${arg_attach-} "${@}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment