1234567891011121314151617181920212223242526 |
- #!/usr/bin/env bash
- registry_host="ccr.ccs.tencentyun.com/wanpinghui"
- project_name="go-example-client"
- exec_name="go-example"
- rm -rf ./bin
- mkdir -p ./bin
- #cp ../tls/*.crt ./bin/
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s" -v -o ./bin/$exec_name ../client/simple_client.go
- for item in $(docker images | grep -E "$registry_host/$project_name\s+\S*" -o);
- do
- if [[ $item != "$registry_host/$project_name" ]];
- then
- echo "remove $registry_host/$project_name:$item"
- docker rmi "$registry_host/$project_name:$item"
- fi
- done
- tag=$(date +%s)
- docker login -u=100010573203 ccr.ccs.tencentyun.com -p=wanpinghui151217
- docker build --no-cache --disable-content-trust=true -t $registry_host/$project_name:$tag .
- docker push $registry_host/$project_name:$tag
|