加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
image.sh 913 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
while [ -n "$1" ]
do
case "$1" in
-r)registory=$2
shift ;;
-v)version=$2
shift ;;
esac
shift
done
if [ "$version" = "" ];then
echo 'please input version with -v'
exit
fi
if [ "$registory" = "" ];then
echo 'please input registory with -r'
exit
fi
docker run -v ~/go/src:/go/src -w="/go/src/icode.baidu.com/baidu/bce-iot/edge-core" golang:alpine /bin/sh build.sh
for module in 'hub' 'function' 'remote_mqtt' 'function_runtime_python2.7'
# for module in 'hub' 'function'
do
name="openedge_$module"
path="module/${module//\_//}"
echo $path
image=$(docker build -f $path/Dockerfile . | grep 'Successfully built' | awk '{print $3}')
echo "$name: $image"
if [ "$image" == "" ];then
echo 'docker build failed'
exit
fi
docker tag $image $registory/$name:$version
docker tag $image $registory/$name:latest
docker push $registory/$name:$version
docker push $registory/$name:latest
done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化