久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網
      最全最豐富的資訊網站

      教你如何搭建Docker私有倉庫

      前言

      ?創(chuàng)建docker私有倉庫的目的在于私密性,適用于團體內部,如公司部門,企業(yè)內部等需要在團體成員中共享docker相關資源的場景。

      ?那么如何搭建屬于自己企業(yè)或團體成員可以使用的docker私有倉庫呢?筆者將通過下面的實際搭建流程結合步驟描述來介紹docker私有倉庫搭建的具體過程。

      • 揭開Docker的面紗 – 基礎理論梳理和安裝流程演示  http://www.sfodin.cn/Linux/2020-04/163003.htm
      • Docker基礎命令詳解 – 鏡像及容器操作  http://www.sfodin.cn/Linux/2020-04/163005.htm
      • 深入理解Docker的硬件資源控制與驗證  http://www.sfodin.cn/Linux/2020-04/163006.htm
      • Docker網絡模式與配置Docker自定義網絡(bridge模式)  http://www.sfodin.cn/Linux/2020-04/163007.htm
      • Docker構建鏡像的三種方式(Dockerfile初步)  http://www.sfodin.cn/Linux/2020-04/163008.htm

      實際案例搭建過程

      1、下載registry鏡像

      [root@localhost ~]# docker pull registry  Using default tag: latest  latest: Pulling from library/registry  486039affc0a: Pull complete   ba51a3b098e6: Pull complete   8bb4c43d6c8e: Pull complete   6f5f453e5f2d: Pull complete   42bc10b72f42: Pull complete   Digest: sha256:7d081088e4bfd632a88e3f3bcd9e007ef44a796fddfe3261407a3f9f04abe1e7  Status: Downloaded newer image for registry:latest  docker.io/library/registry:latest  

      2、生成registry容器,開放5000端口

      [root@localhost ~]# docker create -it registry /bin/bash  fd51aa59dc5cea7b589d0403e562cb8f0098c3a8a7da239572dd5bfd9423ec96  [root@localhost ~]# docker ps -a  CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               NAMES  fd51aa59dc5c        registry            "/entrypoint.sh /bin…"   10 seconds ago      Created                                 optimistic_saha  #建議直接執(zhí)行下面的這個命令,因為筆者遇到start這個容器發(fā)現退出的狀態(tài)碼非0(后面解決了,使用/bin/sh環(huán)境即可)  [root@localhost ~]# docker run -d -p 5000:5000 -v /data/registry:/tmp/registry registry  ceb498d622ab743fc858a993e3870f9831e20436cb71f7225215f1f0899571f1  [root@localhost ~]# docker ps -a  CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES  ceb498d622ab        registry            "/entrypoint.sh /etc…"   2 seconds ago       Up 2 seconds        0.0.0.0:5000->5000/tcp   strange_swanson  

      docker run -d -p 5000:5000 -v /data/registry:/tmp/registry registry命令的解釋:

      -d ——守護進程

      -v ——數據卷設置{/data/registry表示的宿主機系統(tǒng)中的一個絕對路徑,沒有的時候會自動創(chuàng)建,/tmp/registry表示容器內部的目錄}

      #宿主機目錄

      [root@localhost ~]# ls /  bin  boot  data  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var  [root@localhost ~]# ls /data/  registry  

      #容器內部目錄

      [root@localhost ~]# docker exec -it ceb498d622ab /bin/sh  / # ls /  bin            etc            media          root           srv            usr  dev            home           mnt            run            sys            var  entrypoint.sh  lib            proc           sbin           tmp  / # ls tmp/  registry  

      3、客戶端設置daemon.json文件 (指定私有倉庫位置)

      [root@localhost ~]# vim /etc/docker/daemon.json     {    "insecure-registries": ["20.0.0.149:5000"], #將本地服務器作為私有倉庫位置    "registry-mirrors": ["https://5m9y9qbl.mirror.aliyuncs.com"]  }  [root@localhost ~]# systemctl restart docker  

      4、創(chuàng)建本地的鏡像標簽

      [root@localhost ~]# docker pull httpd  Using default tag: latest  latest: Pulling from library/httpd  123275d6e508: Pull complete   e984dd982a6e: Pull complete   963280e5cf81: Pull complete   6faf90d050b2: Pull complete   962b56984bb0: Pull complete   Digest: sha256:d5dc0d279039da76a8b490d89a5c96da83a33842493d4336b42ccdfbd36d7409  Status: Downloaded newer image for httpd:latest  docker.io/library/httpd:latest  
      [root@localhost ~]# docker tag httpd:latest 20.0.0.149:5000/httpd  

      5、上傳鏡像

      [root@localhost ~]# docker push 149:5000/httpd  The push refers to repository [149:5000/httpd]  An image does not exist locally with the tag: 149:5000/httpd  [root@localhost ~]# docker push 20.0.0.149:5000/httpd  The push refers to repository [20.0.0.149:5000/httpd]  9dabb51b1ca2: Pushed   4621e8a6d1da: Pushed   e728c649bc91: Pushed   1a935e59aa8a: Pushed   b60e5c3bcef2: Pushed   latest: digest: sha256:8f10edef61246c6c142a87304d4ffa68298662ecb619776e4e9817d06ec5f567 size: 1367  [root@localhost ~]# curl -XGET http://20.0.0.149:5000/v2/_catalog  {"repositories":["httpd"]}  #有上面的結果表示上傳成功

      6、下載鏡像測試

      [root@localhost ~]# docker images  REPOSITORY              TAG                 IMAGE ID            CREATED                  SIZE  httpd                   latest              bdc169d27d36        Less than a second ago   166MB  20.0.0.149:5000/httpd   latest              bdc169d27d36        Less than a second ago   166MB  registry                latest              708bc6af7e5e        2 months ago             25.8MB  [root@localhost ~]# docker rmi bdc169d27d36   Error response from daemon: conflict: unable to delete bdc169d27d36 (must be forced) - image is referenced in multiple repositories  [root@localhost ~]# docker rmi bdc169d27d36 -f  Untagged: 20.0.0.149:5000/httpd:latest  Untagged: 20.0.0.149:5000/httpd@sha256:8f10edef61246c6c142a87304d4ffa68298662ecb619776e4e9817d06ec5f567  Untagged: httpd:latest  Untagged: httpd@sha256:d5dc0d279039da76a8b490d89a5c96da83a33842493d4336b42ccdfbd36d7409  Deleted: sha256:bdc169d27d36e2438ec8452c7dd7a52a05561b5de7bef8391849b0513a6f774b  Deleted: sha256:6535aa332fb72ca508f550fef8ffb832d4c6bc72a48720b42659e10d47668181  Deleted: sha256:c7bce1fab718a11501a672c895a729b1fdf8099d00fe152bef8c2534ee455976  Deleted: sha256:75b6b2392924b062257ed97e5c2f3aa9f50a922b94c3f7c342d0aed2370e8bec  Deleted: sha256:267e2020b1bd0b182eb02d1a0f3e2f72efc542890ef6159ed9c3570322608de0  Deleted: sha256:b60e5c3bcef2f42ec42648b3acf7baf6de1fa780ca16d9180f3b4a3f266fe7bc  [root@localhost ~]# docker images  REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE  registry            latest              708bc6af7e5e        2 months ago        25.8MB  [root@localhost ~]#   

      測試:

      [root@localhost ~]# docker pull 20.0.0.149:5000/httpd  Using default tag: latest  latest: Pulling from httpd  123275d6e508: Pull complete   e984dd982a6e: Pull complete   963280e5cf81: Pull complete   6faf90d050b2: Pull complete   962b56984bb0: Pull complete   Digest: sha256:8f10edef61246c6c142a87304d4ffa68298662ecb619776e4e9817d06ec5f567  Status: Downloaded newer image for 20.0.0.149:5000/httpd:latest  20.0.0.149:5000/httpd:latest  [root@localhost ~]#   

      拉取成功并且拉取鏡像的速度很快。

      最后給出上面出現的狀態(tài)碼錯誤的問題具體解決

      教你如何搭建Docker私有倉庫

      贊(0)
      分享到: 更多 (0)
      網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號