-
Notifications
You must be signed in to change notification settings - Fork 2
/
start-build.sh
executable file
·45 lines (38 loc) · 1.49 KB
/
start-build.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env sh
# -----------------------------------------------------------------------------
# Docker Build Container
# -----------------------------------------------------------------------------
# Author : Dwi Fahni Denni
# License : Apache v2
# -----------------------------------------------------------------------------
set -e
export CI_PROJECT_PATH="devopscorner"
export CI_PROJECT_NAME="k8s-context"
export IMAGE="$CI_PROJECT_PATH/$CI_PROJECT_NAME"
# TAG="alpine-3.15"
# echo " Build Image => $IMAGE:$TAG"
# docker build --no-cache -f Dockerfile.alpine-3.15 -t $IMAGE:$TAG .
# docker tag $IMAGE:$TAG $IMAGE:go1.19-alpine3.15
# docker tag $IMAGE:$TAG $IMAGE:go1.19.3-alpine3.15
# echo ""
TAG="alpine-3.16"
echo " Build Image => $IMAGE:$TAG"
docker build --no-cache -f Dockerfile.alpine-3.16 -t $IMAGE:$TAG .
docker tag $IMAGE:$TAG $IMAGE:go1.19-alpine3.16
docker tag $IMAGE:$TAG $IMAGE:go1.19.5-alpine3.16
echo ""
TAG="alpine-3.17"
echo " Build Image => $IMAGE:$TAG"
docker build --no-cache -f Dockerfile.alpine-3.17 -t $IMAGE:$TAG .
docker tag $IMAGE:$TAG $IMAGE:go1.19-alpine3.17
docker tag $IMAGE:$TAG $IMAGE:go1.19.5-alpine3.17
docker tag $IMAGE:$TAG $IMAGE:alpine
docker tag $IMAGE:$TAG $IMAGE:alpine-latest
docker tag $IMAGE:$TAG $IMAGE:latest
docker tag $IMAGE:$TAG $IMAGE:1.1.6
echo ""
echo "Cleanup Unknown Tags"
echo "docker images -a | grep none | awk '{ print $3; }' | xargs docker rmi"
docker images -a | grep none | awk '{ print $3; }' | xargs docker rmi
echo ""
echo "-- ALL DONE --"