Skip to content

阿里云容器镜像服务使用

容器镜像服务的概念

https://help.aliyun.com/document_detail/60765.html

什么是命令空间和镜像仓库呢?

命名空间下面有多个镜像仓库,镜像仓库相当于docker的各个镜像,例如:命名空间是chat1、镜像仓库是chat-haproxy的引用路径为registry.cn-hangzhou.aliyuncs.com/chat1/chat-haproxy:v1registry.cn-hangzhou.aliyuncs.com/chat1/chat-mariadb:v1

容器镜像服务的使用

注意:命名空间和仓库类型都选择公有,公有时候push镜像仍然需要登陆,只是pull镜像时候不需要登陆

  • 登陆容器镜像服务控制台的地址https://cr.console.aliyun.com/cn-hangzhou/instances/repositories

  • 设置docker login的固定密码https://cr.console.aliyun.com/cn-hangzhou/instance/credentials

  • 客户端登录容器镜像服务,使客户端支持镜像的pushpull操作

    bash
    docker login --username=dexle registry.cn-hangzhou.aliyuncs.com
  • 客户端退出登录容器镜像服务

    bash
    docker logout registry.cn-hangzhou.aliyuncs.com
  • 推送镜像,注意:推送镜像时,会自动在指定的命名空间下创建镜像仓库。