12345678910111213141516171819 |
- #!/usr/bin/env bash
- registry_host="ccr.ccs.tencentyun.com/wanpinghui"
- project_name="py-example-server"
- 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
|