occlum/demos/bash/run_bash_demo.sh
Zheng, Qi 774ea33d9a Update bash and fish demo with prebuilt busybox
Signed-off-by: Zheng, Qi <huaiqing.zq@antgroup.com>
2021-11-01 12:43:45 +08:00

26 lines
532 B
Bash
Executable File

#! /bin/bash
set -e
if [[ $1 == "musl" ]]; then
echo "*** Run musl-libc bash demo ***"
bomfile="../bash-musl.yaml"
else
echo "*** Run glibc bash demo ***"
bomfile="../bash.yaml"
fi
rm -rf occlum_instance
occlum new occlum_instance
pushd occlum_instance
rm -rf image
copy_bom -f $bomfile --root image --include-dir /opt/occlum/etc/template
new_json="$(jq '.resource_limits.user_space_size = "600MB" ' Occlum.json)" && \
echo "${new_json}" > Occlum.json
occlum build
occlum run /bin/occlum_bash_test.sh
popd