diff options
-rw-r--r-- | Dockerfile | 3 | ||||
-rw-r--r-- | LATEST | 1 | ||||
-rwxr-xr-x | build.sh | 17 |
3 files changed, 19 insertions, 2 deletions
@@ -1,4 +1,5 @@ -FROM astroconda/base:1.0.0 +ARG BASE_VERSION=${BASE_VERSION:latest-} +FROM astroconda/base:${BASE_VERSION} LABEL maintainer="jhunk@stsci.edu" \ vendor="Space Telescope Science Institute" @@ -0,0 +1 @@ +3.7.2 @@ -6,4 +6,19 @@ if [[ -z ${PYTHON_VERSION} ]]; then exit 1 fi -docker build -t ${PROJECT}:${PYTHON_VERSION} --build-arg PYTHON_VERSION=${PYTHON_VERSION} . +BASE_VERSION="${2}" +if [[ -z ${BASE_VERSION} ]]; then + BASE_VERSION="latest" +fi + +is_tag_latest=$([[ -f LATEST ]] && [[ $(<LATEST) == ${PYTHON_VERSION} ]] && echo yes) +if [[ -n ${is_tag_latest} ]]; then + tag_latest="-t ${PROJECT}:latest" +fi + + +docker build -t ${PROJECT}:${PYTHON_VERSION} \ + ${tag_latest} \ + --build-arg PYTHON_VERSION=${PYTHON_VERSION} \ + --build_arg BASE_VERSION=${BASE_VERSION} \ + . |