dianxin-guizhou-forward
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

123456789101112131415161718192021222324252627
  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 gd202101_service || true
  7. docker rm gd202101_service || true
  8. # 删除镜像
  9. docker rmi -f $(
  10. docker images | grep 139.224.254.18:5000/gd202101_service | awk '{print $3}'
  11. )
  12. docker build . -t telpo/gd202101_service:$image_version
  13. #TODO:推送镜像到私有仓库
  14. echo '=================开始推送镜像======================='
  15. docker tag telpo/gd202101_service:$image_version 139.224.254.18:5000/gd202101_service:$image_version
  16. docker push 139.224.254.18:5000/gd202101_service:$image_version
  17. echo '=================推送镜像完成======================='
  18. #删除产生的None镜像
  19. docker rmi -f $(docker images | grep none | awk '{print $3}')
  20. # 查看镜像列表
  21. docker images
  22. # 启动容器
  23. docker run -v /home/data/gd202101server/log:/var/log/gd202101server -d -e active=dev --network host --restart=always --cap-add=SYS_PTRACE --name gd202101_service telpo/gd202101_service:$image_version
  24. # 查看日志
  25. # docker logs gd202101_service