代码拉取完成,页面将自动刷新
同步操作将从 cambriconknight/dev-env-ubuntu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
set -e
# -------------------------------------------------------------------------------
# Filename: run-container-ubuntu-dev.sh
# UpdateDate: 2021/09/27
# Description: Run docker image for IDE.
# Example:
# ./run-container-ubuntu-dev.sh
# ./run-container-ubuntu-dev.sh 16.04
# ./run-container-ubuntu-dev.sh 18.04
# Depends: container-$OS-$PATH_WORK-$VERSION
# Notes:
# -------------------------------------------------------------------------------
#Dockerfile(16.04/18.04/CentOS)
OSVer="16.04"
if [[ $# -ne 0 ]];then OSVer="${1}";fi
# Source env
source ./env.sh $OSVer
######Modify according to your development environment#####
#Share path on the host
PATH_SHARE_HOST="$PWD"
#Share path on the docker container
PATH_SHARE_DOCKER="/home/share"
#SDK path on the host
PATH_FTP_HOST="/data/ftp"
#Work path on the docker container
PATH_FTP_DOCKER="/home/ftp"
#Datasets path on the host
PATH_DATASETS_HOST="/data/datasets"
#Datasets path on the docker container
PATH_DATASETS_DOCKER="/data/datasets"
#Models path on the host
PATH_MODELS_HOST="/data/models"
#Models path on the docker container
PATH_MODELS_DOCKER="/data/models"
##########################################################
#Check docker images
[ ! -z $(sudo docker images -q $NAME_IMAGE) ] || (echo -e "${red}ERROR: Images(${NAME_IMAGE}) does not exist! ${none}" && exit -1)
#Check docker container
num=`sudo docker ps -a|grep -w "$MY_CONTAINER$"|wc -l`
echo $num
echo $MY_CONTAINER
#Run docker
if [ 0 -eq $num ];then
#sudo xhost +
sudo docker run -e DISPLAY=unix$DISPLAY --privileged=true \
--device /dev/cambricon_dev0 \
--net=host --ipc=host --pid=host \
-v /sys/kernel/debug:/sys/kernel/debug \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-it -v $PATH_SHARE_HOST:$PATH_SHARE_DOCKER \
-it -v $PATH_FTP_HOST:$PATH_FTP_DOCKER \
-it -v $PATH_DATASETS_HOST:$PATH_DATASETS_DOCKER \
-it -v $PATH_MODELS_HOST:$PATH_MODELS_DOCKER \
--name $MY_CONTAINER $NAME_IMAGE /bin/bash
else
sudo docker start $MY_CONTAINER
sudo docker exec -ti $MY_CONTAINER /bin/bash
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。