zoukankan      html  css  js  c++  java
  • docker将镜像上传到私有仓库harbor

    1.docker push  命令是镜像上传到远程仓库,默认是上传到官方的仓库,但是我们上传不了,没有账号

    2.   那么我们要将本地的镜像打标签 指向我们自己的仓库

                             

    docker tag hello-world 192.168.255.131:8888/tony/hello-world:v1.0    //hello-world是本地镜像  后面是私有仓库的地址/项目名称/镜像名称:版本号
    

    3.docker  images  可以看到刚才打了标签的镜像,docker push  直接上传镜像

    docker  push  192.168.255.131:8888/tony/hello-world

     上传的过程中 报错了

               

    The push refers to repository [hd-01:8888/tony/hello-world]
    Get https://hd-01:8888/v2/: http: server gave HTTP response to HTTPS client
    [root@hd-01 harbor]# docker  push  docker tag hello-world hd-01:8888/tony/hello-world
    

     默认采用https协议上传,所以我们要/etc/docker/deamon.json修改配置文件,将私有仓库地址加进去,如果没有则创建vi /etc/docker/deamon.json

    {
       "registry-mirrors": ["https://dhq9bx4f.mirror.aliyuncs.com"],   
       "insecure-registries": ["192.168.255.131:8888"]       
    }
    

     重启docker

    service docker restart
    

    在次上传

    docker  push 192.168.255.131:8888/tony/hello-world

     发现还是有问题

    b7efe781401d: Preparing 
    c9c2a3696080: Preparing 
    7b4e562e58dc: Preparing 
    denied: requested access to the resource is denied
    

    好像是没有权限,默认是推到docker官方库,所以我们要登录自己的私有仓库

    docker login 192.168.255.131:8888
    
    Username:admin
    Password:Harbor12345
    

     在次推送

    docker  push 192.168.255.131:8888/tony/hello-world
    

     

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

  • 相关阅读:
    layui弹出层处理(获取、操作弹出层数据等)
    Unity3D判断鼠标向右或向左滑动,响应不同的事件
    (转载)李剑英的CSLight入门指南结合NGUI热更新
    Unity3D研究院之LZMA压缩文件与解压文件
    CSLight研究院之学习笔记结合NGUI(一)
    《暗黑世界GM管理后台系统》部署+功能说明文档
    Firefly卡牌手游《暗黑世界V1.5》服务器端源码+GM管理后台源码
    电信SDK Pay函数里面System.out.print 无输出消息
    WP8:在Unity中使用OpenXLive
    WP8:Unity3D之间的值传递
  • 原文地址:https://www.cnblogs.com/xiaozhican/p/10306871.html
Copyright © 2011-2022 走看看