-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·75 lines (60 loc) · 2.08 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Documentation:
#
# DOCKER_REGISTRY - the user or repo of the container, the container will be pushed as such: $DOCKER_REGISTRY/$IMAGE_NAME
# MULTIARCH - whether or not to use buildx to create a container compatible with different architectures
#
# Usage to build multiarch to jasoryeh/my account: MULTIARCH=1 DOCKER_REGISTRY=jasoryeh PUSH=1 bash build.sh
set -e
WORKING_DIR=$PWD
if [ ! -z ${DOCKER_REGISTRY} ]; then
REGISTRY=${DOCKER_REGISTRY}
fi
if [ -z "$REGISTRY" ]; then
echo "No registry found, please specify a 'DOCKER_REGISTRY' environment variable!"
exit 1
fi
EXP_CLEANUP() {
echo "Cleaning up build environment..."
docker buildx rm -f images-builder
}
if [ ! -z ${MULTIARCH} ]; then
echo "Configuring a ./buildx.toml to support multiarch builds!"
echo "" > buildx.toml
if [ ! -z ${INSECURE_REGISTRY} ]; then
echo "[registry.\"$REGISTRY\"]" >> ./buildx.toml
echo " http = true" >> ./buildx.toml
echo " insecure = true" >> ./buildx.toml
fi
trap EXP_CLEANUP EXIT
docker buildx create --name images-builder --config ./buildx.toml --driver-opt network=host --use --bootstrap
fi
function build {
PUSH=$PUSH MULTIARCH=$MULTIARCH REGISTRY=$REGISTRY bash builder.sh $1 $1 ${2:-Dockerfile} $2
}
function fbuild {
PUSH=$PUSH MULTIARCH=$MULTIARCH REGISTRY=$REGISTRY bash builder.sh $*
}
set -e
if [ ! -d $WORKING_DIR/wg-zero ]; then
git clone https://github.com/jasoryeh/wg-zero.git $WORKING_DIR/wg-zero
else
cd $WORKING_DIR/wg-zero && git pull -f && cd $WORKING_DIR
fi
build wg-zero
if [ ! -d $WORKING_DIR/conductor ]; then
git clone https://github.com/jasoryeh/conductor.git $WORKING_DIR/conductor
else
cd $WORKING_DIR/conductor && git pull -f && cd $WORKING_DIR
fi
build conductor
build conductor-pterodactyl 8.Dockerfile
build conductor-pterodactyl 17.Dockerfile
build conductor-pterodactyl 21.Dockerfile
fbuild conductor-pterodactyl conductor-pterodactyl 21.Dockerfile
build stun
build disposable-minecraft
build registry-auth-proxy
build jenkins-with-dockercli
build pterodactyl-wings
build php-laravel