forked from occlum/occlum
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·64 lines (52 loc) · 1.48 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
#!/bin/bash
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
top_dir=$(dirname "${script_dir}")
# pip mirror is used to accelerate the speed of python pip
pip_mirror="-i https://pypi.douban.com/simple"
registry="demo"
tag="latest"
function usage {
cat << EOM
Build Occlum TF examples container images for k8s deployment.
usage: $(basename "$0") [OPTION]...
-r <container image registry> the container image registry
-g <tag> container image tag
-h <usage> usage help
EOM
exit 0
}
function process_args {
while getopts ":r:g:h" option; do
case "${option}" in
r) registry=${OPTARG};;
g) tag=${OPTARG};;
h) usage;;
esac
done
}
process_args "$@"
echo ""
echo "############################"
echo "Build Occlum TF examples container images for k8s deployment"
echo " Container images registry: ${registry}"
echo " Container images tag: ${tag}"
echo ""
pushd ${top_dir}
echo "Build Occlum instances first ..."
./build_content.sh
echo ""
echo "Build Occlum container images ..."
./build_container_images.sh ${registry} ${tag}
echo ""
echo "Build demo client container image ..."
cp ./ssl_configure/server.crt ./client/
docker build \
--network host \
--build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$https_proxy \
--build-arg pip_mirror="${pip_mirror}" \
-f container/Dockerfile_client \
-t ${registry}/tf_demo_client:${tag} .
echo "Build is done"
popd