-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·49 lines (41 loc) · 1.22 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
45
46
47
48
49
#!/usr/bin/env bash
set -e
[[ -n "${DEBUG}" ]] && set -x
# global variables
SCRIPT_ARGS="$*"
SCRIPT_NAME="$0"
SCRIPT_NAME="${SCRIPT_NAME#\./}"
SCRIPT_NAME="${SCRIPT_NAME##/*/}"
SCRIPT_BASE_DIR="$(cd "$( dirname "$0")" && pwd )"
set -u
build_image() {
local -r imagedirectory="${1}"; shift
local -r imagename="${1}"; shift
pushd "${imagedirectory}"
sudo docker build \
--rm \
-t "${imagename}" . 2>&1 | \
tee docker_build_${imagedirectory}.log
popd
}
docker_cleanup() {
set +e
sudo docker rm -f $(sudo docker ps -a -q) 2>&1
sudo docker rmi $(sudo docker images -q) 2>&1
sudo docker volume rm $(sudo docker volume ls -q) 2>&1
sudo docker network rm $(sudo docker network ls -q) 2>&1
set -e
}
docker_cleanup
build_image "base" "akaer/base"
build_image "Python2" "akaer/python"
build_image "Python3" "akaer/python3"
build_image "govc-builder" "akaer/govc-builder"
build_image "govc" "akaer/govc"
build_image "shellcheck" "akaer/shellcheck"
build_image "ssh-audit" "akaer/ssh-audit"
build_image "OpenDJ" "akaer/opendj"
build_image "Dokuwiki" "akaer/dokuwiki"
build_image "ansible" "akaer/ansible"
build_image "Openjre8" "akaer/openjre8"
#build_image "jupyter" "akaer/jupyter"