Jenkins .net core docker 脚本

#!/bin/bash

echo "====当前目录====";
pwd;
ls;
echo "====当前版本====";
echo "v0.0.${BUILD_NUMBER}";
echo "====开始打包docker镜像====";
docker build -t "hoawebapi:v0.0.${BUILD_NUMBER}" .;
echo "====开始运行docker镜像====";
docker run --name "hoawebapi_v0.0.${BUILD_NUMBER}" -P -d hoawebapi:v0.0.${BUILD_NUMBER};
echo "====输出docker运行日志====";
docker logs "hoawebapi_v0.0.${BUILD_NUMBER}";
echo "====运行成功====";
posted @ 2020-05-29 14:24  百小僧  阅读(192)  评论(0编辑  收藏  举报