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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

centos7镜像加速_docker 镜像加速CentOS7详细介绍

發布時間:2025/3/11 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 centos7镜像加速_docker 镜像加速CentOS7详细介绍 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

在Docker Hub官網上注冊帳號,即可下載使用倉庫里的全部的docker鏡像。而因為網絡原因,國內的開發者沒辦法流暢的下載鏡像,經常會出現下載中斷的錯誤。解決方法就是使用國內的容器Hub加速服務,本質就是更改pull優先級較高的服務器為國內的站點。

國內docker鏡像加速站

阿里云

DaoCloud

靈雀云

系統環境

操作系統: CentOS 7

docker版本: 1.9.1

DaoCloud加速

DaoCloud現在是提供一個一鍵腳本配置registry-mirror,然而對于上述環境是不起作用的。

執行docker守護服務的help命令,發現沒有–registry-mirror這個選項,而是使用–add-registry選項。

具體命令如下:

$ sudo docker daemon -h

Usage: docker daemon [OPTIONS]

Enable daemon mode

--add-registry=[] Registry to query before a public one

--api-cors-header= Set CORS headers in the remote API

-b, --bridge= Attach containers to a network bridge

--bip= Specify network bridge IP

--block-registry=[] Don't contact given registry

--cluster-advertise= Address or interface name to advertise

--cluster-store= Set the cluster store

--cluster-store-opt=map[] Set cluster store options

--confirm-def-push=true Confirm a push to default registry

-D, --debug=false Enable debug mode

--default-gateway= Container default gateway IPv4 address

--default-gateway-v6= Container default gateway IPv6 address

--default-ulimit=[] Set default ulimits for containers

--disable-legacy-registry=false Do not contact legacy registries

--dns=[] DNS server to use

--dns-opt=[] DNS options to use

--dns-search=[] DNS search domains to use

-e, --exec-driver=native Exec driver to use

--exec-opt=[] Set exec driver options

--exec-root=/var/run/docker Root of the Docker execdriver

--fixed-cidr= IPv4 subnet for fixed IPs

--fixed-cidr-v6= IPv6 subnet for fixed IPs

-G, --group=docker Group for the unix socket

-g, --graph=/var/lib/docker Root of the Docker runtime

-H, --host=[] Daemon socket(s) to connect to

--help=false Print usage

--icc=true Enable inter-container communication

--insecure-registry=[] Enable insecure registry communication

--ip=0.0.0.0 Default IP when binding container ports

--ip-forward=true Enable net.ipv4.ip_forward

--ip-masq=true Enable IP masquerading

--iptables=true Enable addition of iptables rules

--ipv6=false Enable IPv6 networking

-l, --log-level=info Set the logging level

--label=[] Set key=value labels to the daemon

--log-driver=json-file Default driver for container logs

--log-opt=map[] Set log driver options

--mtu=0 Set the containers network MTU

-p, --pidfile=/var/run/docker.pid Path to use for daemon PID file

--registry-mirror=[] Preferred Docker registry mirror

-s, --storage-driver= Storage driver to use

--selinux-enabled=false Enable selinux support

--storage-opt=[] Set storage driver options

--tls=false Use TLS; implied by --tlsverify

--tlscacert=~/.docker/ca.pem Trust certs signed only by this CA

--tlscert=~/.docker/cert.pem Path to TLS certificate file

--tlskey=~/.docker/key.pem Path to TLS key file

--tlsverify=false Use TLS and verify the remote

--userland-proxy=true Use userland proxy for loopback traffic

在文件/etc/sysconfig/docker中增加以下代碼:

ADD_REGISTRY='--add-registry [你的加速站網址]'

然后,重啟Docker就可以了。

sudo systemctl daemon-reload

sudo service docker restart

使用鏡像加速

1.拉取鏡像前請先登錄: docker login daocloud.io(請使用用戶名進行 login)

2.docker pull [你需要的鏡像]

后續

經過使用測試:下載docker鏡像時不再出現下載失敗提示,粗略估計下載速度在200k/s左右,基本滿足使用需求。

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

總結

以上是生活随笔為你收集整理的centos7镜像加速_docker 镜像加速CentOS7详细介绍的全部內容,希望文章能夠幫你解決所遇到的問題。

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