#!/bin/bash

# 编译应用
echo "building..."
go build -o queencount-service

# 命名镜像
local_imge="pack-queentree-count:v1.0.0"
repository_image="registry.cn-chengdu.aliyuncs.com/infish/pack-queentree-count:v1.0.0"

# 删除本地已存在的镜像
docker rmi $repository_image

# 创建本地镜像
docker build -t $local_imge .

# 镜像标签
docker tag $local_imge $repository_image

# push到镜像仓库，需要登陆对应docker仓库账号
docker push $repository_image

# 删除编译的文件
rm -rf queencount-service

# 运行示例
# docker run  -itd -p 20001:20001 --name comm-pay-service pay-service:1.0.0








