diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-01-22 11:00:04 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-01-22 11:00:04 -0500 |
commit | f17f08d418e285d28b9b414b657e287556566497 (patch) | |
tree | a561ee1c5a9a110bc4bfedbab0b94a40068560b5 | |
parent | ef1cf4f442fb8ba127e38cbd0976b3ba6ddaa5af (diff) | |
download | docker-pipeline-f17f08d418e285d28b9b414b657e287556566497.tar.gz |
Use python dynamically
* Improve tag situation
-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} . |