We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7103a25 commit d8f7c1fCopy full SHA for d8f7c1f
1 file changed
docker/hooks/build
@@ -5,12 +5,17 @@ set -ex
5
# as build argument. For more information on build hooks and environment
6
# variables, see: https://docs.docker.com/docker-hub/builds/advanced/
7
8
-TAG=${IMAGE_NAME##*:}
9
-if [[ $TAG == latest ]]; then
+# DOCKER_TAG can be : latest, ubuntu-20.04, v1.0.0, v1.0.0-ubuntu-20.04
+
10
+if [[ $DOCKER_TAG =~ "^(latest|v[0-9]+\.[0-9]+\.[0-9]+)$" ]]; then
11
TAG=debian-buster-slim
12
+else
13
+ # Remove vX.X.X- suffix
14
+ TAG=$(echo $DOCKER_TAG | sed 's/v[0-9]\+.[0-9]\+.[0-9]\+-//')
15
fi
16
17
# Replace first '-' by ':'
18
+# ie, ubuntu-20.04 will be ubuntu:20.04 (image name)
19
FROM=${TAG/-/:}
20
21
docker build . \
0 commit comments