-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·44 lines (36 loc) · 1.23 KB
/
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
#!/bin/bash -e
# Absolute path to this script
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in
SCRIPTPATH=$(dirname "${SCRIPT}")
rm -rf $SCRIPTPATH/docker/tmp
mkdir -p $SCRIPTPATH/docker/tmp
versionline=`cat docker/Dockerfile_main | grep "version="`
version=$(sed -E 's|version="(.*)"(.*)|\1|g' <<< $versionline | xargs)
repo="my-repository"
# build main container
tag="${repo}/clamav-rootless"
versiontag="${tag}:${version}${versionsuffix}"
latesttag="${tag}:latest${versionsuffix}"
docker build --pull \
--build-arg http_proxy=$HTTP_PROXY \
--build-arg https_proxy=$HTTPS_PROXY \
--build-arg no_proxy=$NO_PROXY \
--no-cache \
-t $versiontag \
-t $latesttag \
-f docker/Dockerfile_main \
.
# build initcontainer
tag="${repo}/clamav-init"
versiontag="${tag}:${version}${versionsuffix}"
latesttag="${tag}:latest${versionsuffix}"
docker build --pull \
--build-arg http_proxy=$HTTP_PROXY \
--build-arg https_proxy=$HTTPS_PROXY \
--build-arg no_proxy=$NO_PROXY \
--no-cache \
-t $versiontag \
-t $latesttag \
-f docker/Dockerfile_initcontainer \
.