-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
executable file
·36 lines (29 loc) · 1021 Bytes
/
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
#!/bin/sh
set -e
BASEDIR=$(dirname "$0")
DOCKER_PATH="${BASEDIR}/docker"
# Optionally, use a nftlb devel package
if [ -s "$1" ]; then
cp -v "$1" $DOCKER_PATH/zproxy.deb
else
# Use empty file to avoid docker COPY directive failure
touch $DOCKER_PATH/zproxy.deb
fi
# Before running this script, you MUST BE ROOT and you need to have the following tools installed:
# - Docker
# - Docker-machine
# - Minikube (Kubernetes local cluster, virtualized)
# - Golang
# - client-go libs
# STEP 1:
# Compile cmd/app/main.go.
# The binary will be called "app".
#GOOS=linux go build -o $DOCKER_PATH/app ./cmd/zproxy-ingress
# STEP 2:
# The client container will be created using its Dockerfile.
# It will be made for Docker, not for Minikube (this will come later).
docker build -t zproxy-ingress -f $DOCKER_PATH/Dockerfile --build-arg DOCKER_PATH="$DOCKER_PATH" .
# STEP 3:
# Clean residual files.
rm -fv $DOCKER_PATH/app $DOCKER_PATH/zproxy.deb
#~ docker image prune -f --filter label=stage=intermediate