diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-02-07 10:14:58 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-02-07 10:14:58 -0500 |
commit | b0fa760126571f7fd22e1dfa7ee641b195639efc (patch) | |
tree | 96eeb308c62bfdab9e127a4a1e78bbc92e72e8c8 /build.sh | |
parent | dc6b09f58d2a4287bdea5ae2197944a9e93c56c8 (diff) | |
download | docker-python-b0fa760126571f7fd22e1dfa7ee641b195639efc.tar.gz |
Dynamic base version
Use LATEST file to denote which version becomes "latest" tag
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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} \ + . |