#!/bin/bash
result=$(docker ps | grep "192.168.25.130:5000/springboot_jenkins01")
if [[ "$result" != "" ]]
then
echo "stop springboot_jenkins01"
docker stop springboot_jenkins01
fi
result1=$(docker ps -a | grep "192.168.25.130:5000/springboot_jenkins01")
if [[ "$result1" != "" ]]
then
echo "rm springboot_jenkins01"
docker rm springboot_jenkins01
fi
result2=$(docker images | grep "192.168.25.130:5000/springboot_jenkins01")
if [[ "$result2" != "" ]]
then
echo "192.168.25.130:5000/springboot_jenkins01:1.0-SNAPSHOT"
docker rmi 192.168.25.130:5000/springboot_jenkins01:1.0-SNAPSHOT
fi
clean package -f pom_docker_registry.xml -DskipTests docker:build
docker run --name springboot_jenkins01 -p 50101:50101 -idt 192.168.25.130:5000/springboot_jenkins01:1.0-SNAPSHOT
docker logs -f springboot_jenkins01
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |