zoukankan      html  css  js  c++  java
  • 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
    
  • 相关阅读:
    Linux 下判断磁盘是ssd还是hdd
    Ceph rgw COR测试
    nfs 挂载选项
    【Linux命令】dmsetup--device mapper 管理工具(更底层的管理工具)
    Device Mapper 存储介绍
    easyui combotree 默认 初始化时就选中
    EasyUI 添加tab页(iframe方式)(转)
    EasyUI DataGrid 配置参数
    EasyUI 后台接受DataGrid传来的参数
    (转)combogrid的代码实例
  • 原文地址:https://www.cnblogs.com/love-zf/p/15602446.html
Copyright © 2011-2022 走看看