Docker - 阿里云仓库
0.0.准备工作
- 在阿里云上开通"容器镜像服务"
0.1.占位符解释
😂
{
"{YourNamespace}":"阿里云容器镜像服务中的命名空间,具体位置 → 阿里云 / 容器镜像服务 / 实例列表 / 镜像仓库 / 仓库管理 / 命名空间",
"{YourRepoName}":"阿里云容器镜像服务中的镜像仓库,具体位置 → 阿里云 / 容器镜像服务 / 实例列表 / 镜像仓库 / 仓库管理 / 镜像仓库",
}
1.登录阿里云Docker Registry
$ docker login --username=username@aliyun registry.aliyuncs.com
Password:
WARNING! Your password will be stored unencrypted in /home/username/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
2.将镜像推送到Registry
#[ImageId]就是你服务器上的镜像的Id , 可以先使用"docker images"查询一下要推送的镜像Id
#标记本地镜像 , 将其归入阿里云Docker仓库 .
$ docker tag [ImageId] registry.aliyuncs.com/{YourNamespace}/{YourRepoName}:latest
#将本地的镜像上传到镜像仓库 , 要先登陆到镜像仓库 .
$ docker push registry.aliyuncs.com/{YourNamespace}/{YourRepoName}:latest
#以下为输出内容 . . .
The push refers to repository [registry.aliyuncs.com/{YourNamespace}/test]
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
xxxxxxxxxxxx: Pushed
latest: digest: sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx size: 2420
3.从阿里云Docker容器中拉取镜像
#如果仓库类型为"私有"的话,需要先登录,否则报错 .
$ docker pull registry.aliyuncs.com/{YourNamespace}/{YourRepoName}:latest
#以下为输出内容 . . .
Error response from daemon: pull access denied for registry.aliyuncs.com/{YourNamespace}/test, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
#如果仓库类型为"私有"的话,登录之后 , 再次拉取
$ docker pull registry.aliyuncs.com/{YourNamespace}/{YourRepoName}:latest
#以下为输出内容 . . .
latest: Pulling from {YourNamespace}/test
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
xxxxxxxxxxxx: Pull complete
Digest: sha256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Status: Downloaded newer image for registry.aliyuncs.com/{YourNamespace}/{YourRepoName}:latest
registry.aliyuncs.com/{YourNamespace}/{YourRepoName}:latest
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2016-11-25 “基础提供程序在Open上失败”