安于心

文章 分类 评论
7 1 4647

站点介绍

这里是站点介绍...

安于心学习吧

Your description here.

Docker 容器连接

Docker 容器连接前面我们实现了通过网络端口来访问运行在 docker 容器内的服务。容器中可以运行一些网络应用,要让外部也可以访问这些...

Docker 镜像使用

Docker 镜像使用当运行容器时,使用的镜像如果在本地中不存在,docker 就会自动从 docker 镜像仓库中下载,默认是从 Dock...

wuqu

Docker 镜像加速

2023-07-19 14:52

Docker 镜像加速
国内从 DockerHub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务,例如:

科大镜像:https://docker.mirrors.ustc.edu.cn/
网易:https://hub-mirror.c.163.com/
阿里云:https://<你的ID>.mirror.aliyuncs.com
七牛云加速器:https://reg-mirror.qiniu.com
当配置某一个加速器地址之后,若发现拉取不到镜像,请切换到另一个加速器地址。国内各大云服务商均提供了 Docker 镜像加速服务,建议根据运行 Docker 的云平台选择对应的镜像加速服务。

阿里云镜像获取地址:https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors,登陆后,左侧菜单选中镜像加速器就可以看到你的专属地址了:

图片[1]-Docker 镜像加速-6.2

之前还有 Docker 官方加速器 https://registry.docker-cn.com ,现在好像已经不能使用了,我们可以多添加几个国内的镜像,如果有不能使用的,会切换到可以使用个的镜像来拉取。

Ubuntu14.04、Debian7Wheezy
对于使用 upstart 的系统而言,编辑 /etc/default/docker 文件,在其中的 DOCKER_OPTS 中配置加速器地址:

DOCKER_OPTS="--registry-mirror=https://registry.docker-cn.com"
重新启动服务:

$ sudo service docker restart
Ubuntu16.04+、Debian8+、CentOS7
对于使用 systemd 的系统,请在 /etc/docker/daemon.json 中写入如下内容(如果文件不存在请新建该文件):

{"registry-mirrors":["https://reg-mirror.qiniu.com/"]}
之后重新启动服务:

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
Windows 10
对于使用 Windows 10 的系统,在系统右下角托盘 Docker 图标内右键菜单选择 Settings,打开配置窗口后左侧导航菜单选择 Daemon。在 Registrymirrors 一栏中填写加速器地址 https://docker.mirrors.ustc.edu.cn/ ,之后点击 Apply 保存后 Docker 就会重启并应用配置的镜像地址了。

图片[2]-Docker 镜像加速-6.2

Mac OS X
对于使用 Mac OS X 的用户,在任务栏点击 Docker for mac 应用图标-> Perferences…-> Daemon-> Registrymirrors。在列表中填写加速器地址 https://reg-mirror.qiniu.com 。修改完成之后,点击 Apply&Restart 按钮,Docker 就会重启并应用配置的镜像地址了。

图片[3]-Docker 镜像加速-6.2

检查加速器是否生效
检查加速器是否生效配置加速器之后,如果拉取镜像仍然十分缓慢,请手动检查加速器配置是否生效,在命令行执行 docker info,如果从结果中看到了如下内容,说明配置成功。

$ docker info
Registry Mirrors:
https://reg-mirror.qiniu.com

  • Suekiz 2023-09-23 15:37:13
    [url=http://pharmgf.com/tretinoin.html]tretinoin cream 1mg[/url]
  • Eyekiz 2023-09-22 16:15:01
    [url=https://drugstorepp.com/accutane.html]best price generic accutane[/url]
  • Josephjoict 2023-09-21 23:20:24
    [url=http://pharmgf.com/diflucan.html]diflucan usa[/url]
  • SamuelBok 2023-09-21 02:42:38
    [url=http://familystorerx.monster/]brazilian pharmacy online[/url]

JVS常见问题–部署无法成功

部署基础数据存储模块docker-compose -f docker-compose-db.yml up -d执行docker ps 检查...

漏洞及渗透练习平台

漏洞及渗透练习平台:WebGoat漏洞练习环境https://github.com/WebGoat/WebGoathttps://githu...

热门文章

最新评论

  • www.toto79.org

    The game will deal you random cards, and your aim is to match 1 of the winning combinations.

  • ElwoodGox

    [url=http://finasteride.science/propecia.html]propecia online prescription uk[/url]

  • www.1-o.net

    Comparable to personal loans, auto loan qualification requirements vary for every lender and dealership.

  • dubaishopmakeup.com

    I like the helpful information you provide in your articles. I will bookmark your blog and test once more right here regularly. I'm rather sure I'll learn a lot of new stuff proper here! Best of luck for the next!

  • https://tkani-moskva.su/

    %%

  • Google

    Hey would you mind stating which blog platform you're using? I'm looking to start my own blog in the near future but I'm having a tough time deciding between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is because your layout seems different then most blogs and I'm looking for something unique. P.S Sorry for being off-topic but I had to ask!

  • 바이낸스 레퍼럴

    This information is invaluable. How can I find out more?

  • medicine online order

    I like looking through an article that will make men and women think. Also, thank you for allowing for me to comment!

  • مایمیکاپاستوری

    What's up it's me, I am also visiting this website on a regular basis, this website is actually pleasant and the viewers are really sharing pleasant thoughts.

  • visi4d

    When I initially commented I seem to have clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I receive 4 emails with the exact same comment. Perhaps there is a way you can remove me from that service? Kudos!

日历

2023年09月

     12
3456789
10111213141516
17181920212223
24252627282930

标签云

友情链接

推荐关键字:

配色方案