代码拉取完成,页面将自动刷新
#!/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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。