build.sh 449 B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. # 命名镜像
  3. local_imge="search-image:v1.0.0"
  4. repository_image="registry.cn-chengdu.aliyuncs.com/infish/search-image:v1.0.0"
  5. # 删除本地已存在的镜像
  6. docker rmi $repository_image
  7. # 创建本地镜像
  8. docker build -t $local_imge .
  9. # 镜像标签
  10. docker tag $local_imge $repository_image
  11. # push到镜像仓库,需要登陆对应docker仓库账号
  12. # docker push $repository_image
  13. # docker commit container image