加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
docker_runner.sh 995 Bytes
一键复制 编辑 原始数据 按行查看 历史
ZHUOYA ZHOU 提交于 2022-10-06 18:32 . Add files via upload
#!/bin/bash
source docker/docker_config
res=`docker image inspect ${image_name}:${image_tag}`
if [ ${#res} == 2 ] || [ ${force_build} == 1 ]
then
docker image rm ${image_name}:${image_tag}
docker build -f docker/Dockerfile -t ${image_name}:${image_tag} .
echo ""
echo "--------------------"
echo "image built"
echo "--------------------"
echo ""
else
echo ""
echo "--------------------"
echo "image exists"
echo "--------------------"
echo ""
fi
echo "CPU limit: ${CPU_limit}"
echo "RAM limit: ${CPU_limit}"
docker container rm ${container_name}
current_path=`pwd`
#docker_cmd="docker run -it --rm --cpus=${CPU_limit} --memory=${RAM_limit} --name ${container_name} -v ${current_path}:/code ${image_name}:${image_tag} $*"
#for debugging:
docker_cmd="docker run -it --rm --cpus=${CPU_limit} --memory=${RAM_limit} --name ${container_name} -v ${current_path}:/code ${image_name}:${image_tag} bash"
echo $docker_cmd
eval $docker_cmd
exit
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化