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 "====运行成功====";

你可能感兴趣的:(Jenkins .net core docker 脚本)