-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine-build.sh
executable file
·44 lines (36 loc) · 1.3 KB
/
alpine-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/sh
TAG=socks5balancerasio
TAGB=socks5balancerasio-build
# Download sources into build directory
cd alpine-build
# Socks5BalancerAsio - v1.1 (with fix in commit - 37b8cff06bdb7f8c892754e2c8fcf5dc743cf31c)
git clone https://github.com/fossforreal/Socks5BalancerAsio
cd Socks5BalancerAsio
#git checkout 37b8cff06bdb7f8c892754e2c8fcf5dc743cf31c
cd ..
# Build builder docker image
docker build -t $TAGB .
# Run builder to output binary
mkdir output
docker run -v $(pwd)/Socks5BalancerAsio:/Socks5BalancerAsio -v $(pwd)/output:/output $TAGB /build.sh
# Then finally build runner image
cd ..
cd alpine-run
cp ../alpine-build/output/Socks5BalancerAsio ./Socks5BalancerAsio
# strip ./Socks5BalancerAsio # NOW THIS IS RUN IN "BUILDER" DOCKER CONTAINER
docker build -t $TAG .
# Prepare files for demo run
cd ..
cp -r alpine-build/Socks5BalancerAsio/html/ ./html
cp alpine-build/Socks5BalancerAsio/example-config/FullConfig.json ./config.json
# Give help on how to use this & demo
echo
echo We have successfully built Socks5BalancerAsio
echo \(hopefully you have not encountered any errors\)
echo
echo Resulting image: $(docker images $TAG --format "{{.Repository}}:{{.Tag}} -> {{.Size}}")
echo
echo You can test it by running:
echo
echo docker run -v \$\(pwd\)/html:/html -v \$\(pwd\)/config.json:/config.json -it $TAG
echo