北斗定位
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

28 lines
1.1KB

  1. #!/bin/bash
  2. mvn clean
  3. mvn package -Dmaven.test.skip=true
  4. #image_version=$(date +%Y%m%d%H%M)
  5. image_version=$version
  6. docker stop dipperposition_service || true
  7. docker rm dipperposition_service || true
  8. # 删除镜像
  9. docker rmi -f $(docker images | grep telpo/dipperposition_service | awk '{print $3}')
  10. docker build . -t telpo/dipperposition_service:$image_version
  11. #TODO:推送镜像到私有仓库
  12. echo '=================开始推送镜像======================='
  13. docker tag telpo/dipperposition_service:$image_version 139.224.254.18:5000/dipperposition_service:$image_version
  14. docker push 139.224.254.18:5000/dipperposition_service:$image_version
  15. echo '=================推送镜像完成======================='
  16. #删除产生的None镜像
  17. docker rmi -f $(docker images | grep none | awk '{print $3}')
  18. # 查看镜像列表
  19. docker images
  20. # 启动容器
  21. docker run -v /home/data/dipperposition/log:/var/log/dipperposition -d -e active=test --network host --restart=always -p 9011:9011 --name dipperposition_service 139.224.254.18:5000/dipperposition_service:$image_version
  22. # 查看日志
  23. # docker logs dipperposition_service