occlum/demos/grpc/run_server_on_occlum.sh
He Sun 6d7597c25e Polish gRPC and remote attestation demos
1. Disable zlib _explictly_ when building libcurl in remote attestaion demo.
The reason for this is that zlib may be implictly linked by the build system of
libcurl but not the zlib library is not copied into the Occlum FS image.
2. Use `make -j$(nproc)`
3. Fix typos
2020-01-23 04:40:54 +00:00

45 lines
711 B
Bash
Executable File

#!/bin/bash
INSTALL_DIR=/usr/local/occlum/x86_64-linux-musl
export PATH=$PATH:$INSTALL_DIR/bin
cd server
make -j$(nproc)
if [ $? -ne 0 ]
then
echo "demo make failed"
exit 1
fi
rm -rf occlum_context
mkdir occlum_context
cd occlum_context
occlum init
if [ $? -ne 0 ]
then
echo "occlum init failed"
exit 1
fi
mkdir -p image/etc
cp /etc/resolv.conf image/etc
cp ../greeter_server image/bin
cp $INSTALL_DIR/lib/libprotobuf.so.3.10.0.0 image/lib
cp $INSTALL_DIR/lib/libcares.so.2 image/lib
cp $INSTALL_DIR/lib/libz.so.1 image/lib
if [ $? -ne 0 ]
then
echo "libraries copied failed"
exit 1
fi
occlum build
if [ $? -ne 0 ]
then
echo "occlum build failed"
exit 1
fi
occlum run /bin/greeter_server