server_build.sh 604 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. registry_host="ccr.ccs.tencentyun.com/wanpinghui"
  3. project_name="py-example-server"
  4. for item in $(docker images | grep -E "$registry_host/$project_name\s+\S*" -o);
  5. do
  6. if [[ $item != "$registry_host/$project_name" ]];
  7. then
  8. echo "remove $registry_host/$project_name:$item"
  9. docker rmi "$registry_host/$project_name:$item"
  10. fi
  11. done
  12. tag=$(date +%s)
  13. docker login -u=100010573203 ccr.ccs.tencentyun.com -p=wanpinghui151217
  14. docker build --no-cache --disable-content-trust=true -t $registry_host/$project_name:$tag .
  15. docker push $registry_host/$project_name:$tag