1 Star 0 Fork 0

心已渐蓝/assuremappingtools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run-docker 1.69 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
# exit when any command fails
set -e
# Functions
function help()
{
cat << EOF >&2
Usage: ${0##*/} [options]
This run script will assist you to run assuremappingtools container
-h,--help Show this help
Optional:
-b,--branch Branch name or tag name, if not provided it uses master.
-w,--workspace Absolute path for the working directory, if not provided no workspace added
This should be used to access your files on the host machine.
EOF
}
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
help
exit 0 ;;
-b|--branch)
TAG="$2"
shift 2 ;;
-w|--workspace)
if [[ "${2:0:1}" = "/" ]]; then
if [[ -d $2 ]]; then
WORKSPACE="$2"
else
echo "The provided workspace is not exist: $2" >&2
exit 1
fi
else
echo "The provided workspace path should be absolute" >&2
exit 1
fi
shift 2 ;;
--)
shift; break ;;
*)
echo "Unknown option: $1" >&2
exit 1 ;;
esac
done
if [ -z "$TAG" ]
then
echo "No specific tag provided using 'master'"
TAG=master
else
echo "tag specified using '${TAG}'"
fi
if [ -z "$WORKSPACE" ]
then
echo "No specific workspace path provided. Running without workspace."
else
echo "using '${WORKSPACE}' as data workspace and added as volume under '/assuremappingtools/Maps'"
ADD_VOLUME="-v ${WORKSPACE}:/assuremappingtools/Maps"
fi
xhost + && \
docker run -it --rm \
--env="DISPLAY=$DISPLAY" \
${ADD_VOLUME} \
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
--device=/dev/dri/card0:/dev/dri/card0 \
--privileged \
zatitech/assuremappingtools:${TAG}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/guangxibeiliushi/assuremappingtools.git
git@gitee.com:guangxibeiliushi/assuremappingtools.git
guangxibeiliushi
assuremappingtools
assuremappingtools
master

搜索帮助