docker使用阿里云Docker镜像库加速(修订版)

看到我的这个博客点击率很高,但是教程再好再详细,时间久了,东西变了,教程也就变成了无用的教程。
随着docker的更新,以前的修改源的方法已经不适用了
今天我安装了下docker18.02CE的版本,发现教程不能用了,所以再补一次
vim /etc/docker/daemon.json 这个json文件不存在的,不需要担心,直接编辑
把下面的贴进去,保存,重启即可

{
  "registry-mirrors": [ "https://pee6w651.mirror.aliyuncs.com"]
}

如果觉得用这个地址有问题,可以换成网易的
http://hub-mirror.c.163.com

下面的就不用再看了,老版本的可以参考下,

官方镜像下载实在是慢,于是开通了阿里云开发者帐号,
阿里的文档是错误的,

sudo sed -i "s|ExecStart=/usr/bin/docker daemon|ExecStart=/usr/bin/docker daemon --registry-mirror=https://pee6w651.mirror.aliyuncs.com|g" /etc/systemd/system/docker.service 

这一句改为
sudo sed -i “s|ExecStart=/usr/bin/dockerd|ExecStart=/usr/bin/dockerd –registry-mirror=https://pee6w651.mirror.aliyuncs.com|g” /etc/systemd/system/docker.service

下面的全改,如果非阿里云服务器可以改成网易的
ExecStart=/usr/bin/dockerd –registry-mirror=http://hub-mirror.c.163.com
官方帮助

阿里云Docker镜像库

阿里云容器Hub服务:http://dev.aliyun.com/search.html

来自云端的容器Hub服务

高性能的本地Registry,提供上传、下载、构建及托管的全方位镜像服务。

并且为用户提供加速器,加速官方仓库的下载。加速器使用帮>助:http://console.d.aliyun.com/index2.html/?spm=0.0.0.0.Xx1dX0#/docker/booster

阿里云Hub服务管理后台:http://console.d.aliyun.com/index2.html/?>spm=0.0.0.0.MVZTDP#/docker/image/list

在这里开通容器Hub服务,就可以管理您自己的Docker仓库以及仓库镜像。

本人专属加速器地址:https://pee6w651.mirror.aliyuncs.com

ubuntu

安装或升级Docker

请安装1.6.0以上版本的Docker。 
您可以通过阿里云的镜像仓库下载: mirrors.aliyun.com/help/docker-engine

curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
配置Docker加速器

您可以使用如下的脚本将mirror的配置添加到docker daemon的启动参数中。

echo "DOCKER_OPTS=\"--registry-mirror=https://pee6w651.mirror.aliyuncs.com\"" | sudo tee -a /etc/default/docker
sudo service docker restart

centos

安装或升级Docker

请安装1.6.0以上版本的Docker。 
您可以通过阿里云的镜像仓库下载: mirrors.aliyun.com/help/docker-engine

curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -
配置Docker加速器

您可以使用如下的脚本将mirror的配置添加到docker daemon的启动参数中。

# 系统要求 CentOS 7 以上,Docker 1.9 以上。

sudo cp -n /lib/systemd/system/docker.service /etc/systemd/system/docker.service
sudo sed -i "s|ExecStart=/usr/bin/docker daemon|ExecStart=/usr/bin/docker daemon --registry-mirror=https://pee6w651.mirror.aliyuncs.com|g" /etc/systemd/system/docker.service
sudo systemctl daemon-reload
sudo service docker restart

windows

安装或升级Docker

推荐您安装Docker ToolboxToolbox的介绍和帮助: mirrors.aliyun.com/help/docker-toolbox 
Windows系统的安装文件目录: mirrors.aliyun.com/docker-toolbox/windows

快速开始

# 创建一台安装有Docker环境的Linux虚拟机,指定机器名称为default
docker-machine create -d virtualbox default

# 查看机器的环境配置,并配置到本地。然后通过Docker客户端访问Docker服务。
docker-machine env default
eval "$(docker-machine env default)"
docker info
配置Docker加速器

您可以使用如下的脚本将mirror的配置添加到docker daemon的启动参数中。

docker-machine ssh default "echo 'EXTRA_ARGS=\"--registry-mirror=https://pee6w651.mirror.aliyuncs.com\"' | sudo tee -a /var/lib/boot2docker/profile"
docker-machine restart default 

macos

安装或升级Docker

推荐您安装Docker ToolboxToolbox的介绍和帮助: mirrors.aliyun.com/help/docker-toolbox 
Mac系统的安装文件目录: mirrors.aliyun.com/docker-toolbox/mac

快速开始

# 创建一台安装有Docker环境的Linux虚拟机,指定机器名称为default
docker-machine create -d virtualbox default

# 查看机器的环境配置,并配置到本地。然后通过Docker客户端访问Docker服务。
docker-machine env default
eval "$(docker-machine env default)"
docker info
配置Docker加速器

您可以使用如下的脚本将mirror的配置添加到docker daemon的启动参数中。

docker-machine ssh default "echo 'EXTRA_ARGS=\"--registry-mirror=https://pee6w651.mirror.aliyuncs.com\"' | sudo tee -a /var/lib/boot2docker/profile"
docker-machine restart default
  • 11
    点赞
  • 39
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 9
    评论
80 hands-on recipes to efficiently work with the Docker 1.6 environment on Linux About This Book Provides practical techniques and knowledge of various emerging and developing APIs to help you create scalable services Create, manage, and automate production-quality services while dealing with inherent issues Each recipe is carefully organized with instructions to complete the task efficiently Who This Book Is For Docker Cookbook is for developers, system administrators, and DevOps engineers who want to use Docker in his/her development, QA, or production environments. It is expected that the reader has basic Linux/Unix skills such as installing packages, editing files, managing services, and so on. Any experience in virtualization technologies such as KVM, XEN, and VMware will help the reader to relate with container technologies better, but it is not required. In Detail Docker is a Linux container engine that allows you to create consistent, stable, and production-quality environments with containers. You will start by installing Docker and understanding and working with containers and images. You then proceed to learn about network and data management for containers. The book explores the RESTful APIs provided by Docker to perform different actions such as image/container operations. Finally, the book explores logs and troubleshooting Docker to solve issues and bottlenecks. This book will also help you understand Docker use cases, orchestration, security, ecosystems, and hosting platforms to make your applications easy to deploy, build, and collaborate on. Table of Contents Chapter 1. Introduction and Installation Chapter 2. Working with Docker Containers Chapter 3. Working with Docker Images Chapter 4. Network and Data Management for Containers Chapter 5. Docker Use Cases Chapter 6. Docker APIs and Language Bindings Chapter 7. Docker Performance Chapter 8. Docker Orchestration and Hosting Platforms Chapter 9. Docker Security Chapter 10. Getting Help and Tip

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

bwlab

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值