-
-
Save genki/635eaf24b62fdf0e3adea64e9151eb78 to your computer and use it in GitHub Desktop.
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/sh | |
while [ "`echo $1 | cut -c1`" = "-" ]; do | |
OPT="$OPT $1" | |
shift | |
done | |
IMG_TAG=`echo $1 | awk -F\@ '{print $1}'` | |
CMD=`echo $1 | awk -F\@ '{print $2}'` | |
IMG=`echo $IMG_TAG | awk -F: '{print $1}'` | |
TAG=`echo $IMG_TAG | awk -F: '{print $2}'` | |
if [ -z "$CMD" ]; then | |
CMD=`echo $IMG | sed 's/.*\///'` | |
fi | |
docker run --rm -it -v$PWD:/mnt -w/mnt --entrypoint $CMD $OPT $IMG_TAG "${@:2}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment