-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDotnet-Playground build.sh
executable file
·47 lines (40 loc) · 1.17 KB
/
Dotnet-Playground 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
46
#!/bin/bash
DOCKER=/usr/bin/docker
#DOCKER=echo
image=''
dockerfile_name=''
dockerfile_suffix=''
dockerfile_args=''
case $1 in
"latest"|"ubuntu"|"default"|"debian")
image="latest";
dockerfile_name="Dockerfile";
echo "image would be $image";
;;
"" | "alpine")
image="alpine";
dockerfile_name="Dockerfile.alpine";
echo "image would be $image";
;;
esac
case $2 in
"oracle")
dockerfile_suffix=".oracle"
dockerfile_args="--build-arg BUILD_CONFIG=Oracle"
echo "subimage would be $dockerfile_suffix"
;;
*)
dockerfile_suffix=""
dockerfile_args=""
echo "default subimage"
;;
esac
#echo "${dockerfile_name}${dockerfile_suffix} | chaosengine/dotnetplayground:${image}${dockerfile_suffix}_last"
#exit 0
$DOCKER tag "chaosengine/dotnetplayground:${image}${dockerfile_suffix}" "chaosengine/dotnetplayground:${image}${dockerfile_suffix}_last"
DOCKER_BUILDKIT=1 $DOCKER build \
--build-arg SOURCE_BRANCH="$(git rev-parse --abbrev-ref HEAD)" \
--build-arg SOURCE_COMMIT="$(git rev-parse HEAD)" $dockerfile_args \
--progress=auto \
-f "${dockerfile_name}" \
-t "chaosengine/dotnetplayground:${image}${dockerfile_suffix}" .