-
Notifications
You must be signed in to change notification settings - Fork 34
/
build_image.sh
executable file
·28 lines (22 loc) · 802 Bytes
/
build_image.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
#!/bin/sh
VERSION=2.1
mirrorAddr=registry.baidubce.com/paddledtx
# build executor image
executorBinary=executor
executorClientBinary=executor-cli
requesterClientBinary=requester-cli
# use temporary container to compile output, making working image more simplified
docker run -it --rm \
-v ${PWD}:/workspace \
-v ~/.ssh:/root/.ssh \
-w /workspace \
-e GONOSUMDB=* \
-e GOPROXY=https://goproxy.cn \
-e GO111MODULE=on \
golang:1.13.4 bash -c "go build -o ./bin/$executorBinary && go build -o ./bin/$executorClientBinary ./executor/cmd \
&& go build -o ./bin/$requesterClientBinary ./requester/cmd && chmod 777 ./bin" \
# build image
docker rmi -f $mirrorAddr/paddledtx-dai:${VERSION}
docker build -t $mirrorAddr/paddledtx-dai:${VERSION} .
# clean binary
rm -rf ./bin