Last active
January 11, 2017 05:54
-
-
Save mterzo/9b2de53bd8c30d9f19d1c33fe5493483 to your computer and use it in GitHub Desktop.
Shell function to wrap python development in docker
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
pyenv(){ | |
if [ $# -gt 0 ]; then | |
ver=$1 | |
else | |
ver='2.7' | |
fi | |
case $ver in | |
'2.6') | |
name="2-6" | |
container='terzom/python' | |
;; | |
*) | |
name=$(echo $ver|awk '{sub(/\./, "-"); print}') | |
container="python:$ver" | |
;; | |
esac | |
docker run --hostname py$name -it -v ${PWD}:/src -w /src \ | |
${container} /bin/bash | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment