blob: 379e31b775292347adff31ebd901d2661c9dee18 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
PYTHON_VERSION=${PYTHON_VERSION:-}
HUB=${HUB:-}
if [[ -n ${1} ]]; then
PYTHON_VERSION=${1}
fi
if [[ -n ${2} ]]; then
HUB=${2}
fi
if [[ -z ${PYTHON_VERSION} ]]; then
echo "Missing python version (format: x.y.z)"
exit 1
fi
if [[ -z ${HUB} ]]; then
echo "Missing dockerhub repo (format: reponame)"
exit 1
fi
short_version=${PYTHON_VERSION/./}
if [[ ${#short_version} < 2 ]]; then
echo "Python version is too short. Must be in x.y.z format"
exit 1
fi
short_version=${short_version:0:2}
IMAGE="buildsys-py${short_version}"
docker build --build-arg PYTHON_VERSION=${PYTHON_VERSION} -t buildsys-py${short_version} .
|