diff --git a/fs_package_docker_image.sh b/fs_package_docker_image.sh index 56724690..422fea30 100755 --- a/fs_package_docker_image.sh +++ b/fs_package_docker_image.sh @@ -6,9 +6,10 @@ cd server/$name CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o ./bin/api-$name-srv ./$name.go #删除之前旧的镜像 docker rmi -f api-$name-srv:latest +docker rmi -f registry.cn-hangzhou.aliyuncs.com/fusen/fusen_docker_hub:latest #打包docker镜像 docker build -t api-$name-srv:latest . -#把本地镜像load到k8s中(这个适用于无dockerhub镜像仓库情况,需要对应的deployment中的 imagePullPolicy 参数从 Always 变成None) -#minikube image load api-$name-srv:latest -#上传镜像到dockerhub(有dockerhub镜像仓库后打开,且把上面的load image去掉,对应的deployment中的 imagePullPolicy 参数从 None 改为 Always) -#docker push api-$name-srv:latest \ No newline at end of file +#打tag(测试环境,正式把fusen-test改成fusen) +docker tag api-$name-srv:latest registry.cn-hangzhou.aliyuncs.com/fusen-test/$name:latest +#推送到阿里云镜像库(测试环境,正式把fusen-test改成fusen) +docker push registry.cn-hangzhou.aliyuncs.com/fusen-test/$name:latest \ No newline at end of file