forked from yesup/tensorflow-serving-client-java
-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.sh
executable file
·30 lines (24 loc) · 812 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
#!/bin/bash
set -e
cd $(dirname ${BASH_SOURCE[0]})
builder="figroc/tfsclient:build"
if [[ -z "$(docker images -q ${builder})" ]]; then
docker build -t ${builder} --build-arg HTTP_PROXY=${ALL_PROXY} .
fi
if [[ "$(uname)" != "Darwin" && "$(id -u)" != "1000" ]]; then
(
echo "WARNING: Current user $(whoami)($(id -u):$(id -g))" \
"does not match the user gradle(1000:1000) in the container."
echo "The building might fail for unable to access dirs:" \
".gralde, build and obj."
) 1>&2
for d in .gradle build obj; do
mkdir -p ${d}
chmod -R go+rw ${d}
done
chmod go+rw .
fi
workspace=/work/tensorflow-serving-client
docker run --rm -w=${workspace} \
-e ALL_PROXY -e GOPROXY -e HTTP_PROXY=${ALL_PROXY} \
-v $(pwd):${workspace} ${builder} gradle --no-daemon "$@"