5 Star 13 Fork 7

cambriconknight/mlu220-cross-compile-docker-image

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
load-image-mlu220-cross-compile.sh 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
kang 提交于 2021-07-27 20:35 . Optimize code
#!/bin/bash
set -e
# -------------------------------------------------------------------------------
# Filename: load-image-mlu220-cross-compile.sh
# UpdateDate: 2021/07/26
# Description: Loading docker image for IDE.
# Example: ./load-image-mlu220-cross-compile.sh
# Depends: image-$OS-$PATH_WORK-$VERSION.tar.gz
# Notes:
# -------------------------------------------------------------------------------
# Source env
source "./env.sh"
#################### main ####################
# 0.Check param
if [[ $# -eq 0 ]];then
echo -e "${yellow}WARNING: Load images(${FULLNAME_IMAGE}) by default. ${none}"
else
FULLNAME_IMAGE="${1}"
fi
# 0.Check File Images
if [[ ! -f ${FULLNAME_IMAGE} ]]; then
echo -e "${red}ERROR: Images(${FULLNAME_IMAGE}) does not exist! ${none}" && exit -1
fi
if [[ ! ${FULLNAME_IMAGE} =~ ${FILENAME_IMAGE} ]]; then
echo -e "${red}ERROR: Images(${FULLNAME_IMAGE}), please use images(fileName:${FILENAME_IMAGE})! ${none}" && exit -1
fi
# 0.Check Docker Images
num=`sudo docker images | grep -w "$MY_IMAGE" | grep -w "$VERSION" | wc -l`
echo $num
echo $NAME_IMAGE
# 1.Load Docker Images
if [ 0 -eq $num ];then
echo "The image($NAME_IMAGE) is not loaded and is loading......"
#load image
sudo docker load < ${FULLNAME_IMAGE}
else
echo "The image($NAME_IMAGE) is already loaded!"
fi
#echo "All image information:"
#sudo docker images
echo "The image($NAME_IMAGE) information:"
sudo docker images | grep -e "REPOSITORY" -e $MY_IMAGE
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cambriconknight/mlu220-cross-compile-docker-image.git
git@gitee.com:cambriconknight/mlu220-cross-compile-docker-image.git
cambriconknight
mlu220-cross-compile-docker-image
mlu220-cross-compile-docker-image
master

搜索帮助