diff options
-rw-r--r-- | Dockerfile | 3 | ||||
-rwxr-xr-x | build.sh | 15 |
2 files changed, 16 insertions, 2 deletions
@@ -1,4 +1,5 @@ -FROM astroconda/python:3.7.1 +ARG PYTHON_VERSION +FROM astroconda/python:${PYTHON_VERSION} LABEL maintainer="jhunk@stsci.edu" \ vendor="Space Telescope Science Institute" @@ -6,4 +6,17 @@ if [[ -z ${PIPELINE} ]]; then exit 1 fi -docker build -t ${PROJECT}:${PIPELINE} --build-arg PIPELINE=${PIPELINE} . +PYTHON_VERSION="${2}" +if [[ -z ${PIPELINE} ]]; then + echo "Need a fully qualified python version [e.g. 3.7.1]" + exit 1 +fi + +SUFFIX=${PYTHON_VERSION//\./} +if [[ -z ${SUFFIX} ]]; then + echo "Unable to determine tag suffix from python version." + exit 1 +fi + +TAG="${PROJECT}:${PIPELINE}_py${SUFFIX}" +docker build -t ${TAG} --build-arg PIPELINE=${PIPELINE} --build-arg PYTHON_VERSION=${PYTHON_VERSION} . |