日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Docker加速器 DaoCloud

發布時間:2023/12/20 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Docker加速器 DaoCloud 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

由于眾所周知的原因,從Docker Hub難以高效地下載鏡像。

除了使用VPN或代理之外,最為有效的方式就是使用Docker國內鏡像。

DaoCloud是首個提供國內免費Docker Hub鏡像的團體,可以使用DaoCloud團隊提供的Docker Hub Mirror服務。

Docker加速器簡介

Docker加速器是 DaoCloud 推出的 Docker Hub Mirror 服務的官方名稱。

Docker加速器提供Docker Registry(Docker Hub)在中國的鏡像代理服務,為中國用戶在國內服務器上緩存諸多鏡像。

當用戶的Docker設定了--registry-mirror參數后,用戶的Docker拉取鏡像時,首先去Docker加速器中查找鏡像,若命中則說明該鏡像已經在Docker加速器中緩存,用戶直接從Docker加速器中下載。

若沒有命中,則說該鏡像還沒有被緩存,那么Docker加速器首先會被驅使去Docker Hub中下載該鏡像,并進行緩存,最終讓用戶從Docker加速器中下載該鏡像。

Docker加速器使用說明

在DaoCloud注冊并登錄。

在登錄后的頁面(https://dashboard.daocloud.io/),點擊“產品->加速器”標簽,根據新彈出的頁面中“配置 Docker 加速器”信息,更改自己的 Docker 配置文件,然后重啟Docker,使之生效。

注意:此時,從“配置 Docker 加速器”信息中,我們其實已經得到一個免費的docker鏡像地址,類似于“http://abcd1234.m.daocloud.io”。

示例:配置及使用Docker加速器

這里以Linux系統為例。

Linux

curl -sSL?https://get.daocloud.io/daotools/set_mirror.sh?| sh -s?http://abcd1234.m.daocloud.io

該腳本可以將 --registry-mirror 加入到你的 Docker 配置文件 /etc/default/docker 中。適用于 Ubuntu14.04、Debian、CentOS6 、CentOS7、Fedora、Arch Linux、openSUSE Leap 42.1,其他版本可能有細微不同。更多詳情請訪問文檔。

配置Docker加速器

[root@CentOS-7 ~]# uname -aLinux CentOS-7 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux[root@CentOS-7 ~]#[root@CentOS-7 ~]# cat /etc/redhat-releaseCentOS Linux release 7.2.1511 (Core)[root@CentOS-7 ~]#[root@CentOS-7 ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://abcd1234.m.daocloud.ioSuccess.You need to restart docker to take effect: sudo systemctl restart docker[root@CentOS-7 ~]#[root@CentOS-7 ~]# systemctl restart docker[root@CentOS-7 ~]#

如果重啟失敗就手動配置一下加速器在從啟,步驟:

  • 創建或修改 /etc/docker/daemon.json 文件,修改為如下形式 (請將 加速地址 替換為在加速器頁面獲取的專屬地址)
  • {"registry-mirrors": ["加速地址"],"insecure-registries": []}
  • systemctl restart docker
  • 使用Docker加速器拉取鏡像

    [root@CentOS-7 ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE[root@CentOS-7 ~]#[root@CentOS-7 ~]# docker run ubuntuUnable to find image 'ubuntu:latest' locallyTrying to pull repository docker.io/library/ubuntu ...latest: Pulling from docker.io/library/ubuntub3e1c725a85f: Pull complete4daad8bdde31: Pull complete63fe8c0068a8: Pull complete4a70713c436f: Pull completebd842a2105a8: Pull completeDigest: sha256:dbe36a89ad8daf8bbd2a68f14eab18b969d3f125104da51df6337bbf08d1c8aeStatus: Downloaded newer image for docker.io/ubuntu:latest[root@CentOS-7 ~]#[root@CentOS-7 ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEdocker.io/ubuntu latest 104bec311bcd 8 days ago 128.9 MB[root@CentOS-7 ~]#

    ?

    總結

    以上是生活随笔為你收集整理的Docker加速器 DaoCloud的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。