build.sh 675 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # 编译应用
  3. echo "building..."
  4. go build -o tree-service
  5. # 命名镜像
  6. # 202240821 适配大文档source文件模型转换
  7. local_imge="pack-queentree-tree:v1.0.1"
  8. repository_image="registry.cn-chengdu.aliyuncs.com/infish/pack-queentree-tree:v1.0.1"
  9. # 删除本地已存在的镜像
  10. docker rmi $repository_image
  11. # 创建本地镜像
  12. docker build -t $local_imge .
  13. # 镜像标签
  14. docker tag $local_imge $repository_image
  15. # push到镜像仓库,需要登陆对应docker仓库账号
  16. docker push $repository_image
  17. # 删除编译的文件
  18. rm -rf tree-service
  19. # 运行示例
  20. # docker run -itd -p 20001:20001 --name comm-pay-service pay-service:1.0.0