occlum/demos/deployment/deploy_image_test.sh
2021-07-20 13:44:34 +08:00

17 lines
499 B
Bash
Executable File

#! /bin/bash
set -xe
if [[ $1 != "ubuntu18.04" && $1 != "centos8.2" ]]; then
echo "Must choose between <ubuntu18.04/centos8.2>."
exit 1
fi
OS=$1
DEVICE_OPTION="--device /dev/isgx"
docker build -f Dockerfile_template."$OS" -t test-package:"$OS" .
name="$OS"_deploy_test
docker rm -f $name || true
docker run --name="$name" --hostname="$name" --net="host" --privileged $DEVICE_OPTION test-package:"$OS" bash -c "source /root/.bashrc; cd /root/occlum-instance; occlum run /bin/hello_world"