容器服务Docker&Kubernetes 关注
手机版

Docker CE 镜像源站

  1. 云栖社区>
  2. 容器服务Docker&Kubernetes>
  3. 博客>
  4. 正文

Docker CE 镜像源站

hyzhou 2017-06-26 15:28:15 浏览81299 评论26

摘要: Docker CE 镜像源站

Docker CE 镜像源站

使用官方安装脚本自动安装

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

手动安装帮助

Ubuntu 14.04 16.04 (使用apt-get进行安装)

# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装 Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce

# 安装指定版本的Docker-CE:
# Step 1: 查找Docker-CE的版本:
# apt-cache madison docker-ce
#   docker-ce | 17.03.1~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
#   docker-ce | 17.03.0~ce-0~ubuntu-xenial | http://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# Step 2: 安装指定版本的Docker-CE: (VERSION 例如上面的 17.03.1~ce-0~ubuntu-xenial)
# sudo apt-get -y install docker-ce=[VERSION]

CentOS 7 (使用yum进行安装)

# step 1: 安装必要的一些系统工具
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
# Step 2: 添加软件源信息
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# Step 3: 更新并安装 Docker-CE
sudo yum makecache fast
sudo yum -y install docker-ce
# Step 4: 开启Docker服务
sudo service docker start

# 注意:
# 官方软件源默认启用了最新的软件,您可以通过编辑软件源的方式获取各个版本的软件包。例如官方并没有将测试版本的软件源置为可用,你可以通过以下方式开启。同理可以开启各种测试版本等。
# vim /etc/yum.repos.d/docker-ce.repo
#   将 [docker-ce-test] 下方的 enabled=0 修改为 enabled=1
#
# 安装指定版本的Docker-CE:
# Step 1: 查找Docker-CE的版本:
# yum list docker-ce.x86_64 --showduplicates | sort -r
#   Loading mirror speeds from cached hostfile
#   Loaded plugins: branch, fastestmirror, langpacks
#   docker-ce.x86_64            17.03.1.ce-1.el7.centos            docker-ce-stable
#   docker-ce.x86_64            17.03.1.ce-1.el7.centos            @docker-ce-stable
#   docker-ce.x86_64            17.03.0.ce-1.el7.centos            docker-ce-stable
#   Available Packages
# Step2 : 安装指定版本的Docker-CE: (VERSION 例如上面的 17.03.0.ce.1-1.el7.centos)
# sudo yum -y install docker-ce-[VERSION]

安装校验

root@iZbp12adskpuoxodbkqzjfZ:$ docker version
Client:
 Version:      17.03.0-ce
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 07:52:04 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.0-ce
 API version:  1.26 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   3a232c8
 Built:        Tue Feb 28 07:52:04 2017
 OS/Arch:      linux/amd64
 Experimental: false

参考资料

其他关于旧版本Docker卸载以及测试开发版本Docker安装的帮助,可以参考官方文档的说明进行安装

【云栖快讯】你想见的Java技术专家都在这了,向大佬提问,有问题必答  详情请点击

网友评论

21F
1960391739146046

请教下,Freenas可以安装DOCKER吗?

22F
easonjim

经过测试,在本地机房会访问到这个地址:http://mirrors.aliyuncs.com,这个是内网IP,执行的命令如下:
yum-config-manager \

--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

yum-config-manager --enable docker-ce-edge
yum makecache fast
yum install -y docker-ce

23F
1598303816305714

centos7安装以后systemctl命令启用docker服务报错,(Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.)可以问一下 这个是因为什么么

24F
1696490246985143

Failed to install on an ARM dev board

Reproduction

firefly@firefly:~$ curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

Executing docker install script, commit: 36b78b2
  • sudo -E sh -c 'apt-get update -qq >/dev/null'
  • sudo -E sh -c 'apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null'
  • sudo -E sh -c 'curl -fsSL "https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null'
    Warning: apt-key output should not be parsed (stdout is not a terminal)
  • sudo -E sh -c 'echo "deb [arch=arm64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic edge" > /etc/apt/sources.list.d/docker.list'
  • '[' ubuntu = debian ']'
  • sudo -E sh -c 'apt-get update -qq >/dev/null'
  • sudo -E sh -c 'apt-get install -y -qq --no-install-recommends docker-ce >/dev/null'
    E: Sub-process /usr/bin/dpkg returned an error code (1)
Next: Re-type the last command which returned the error code

firefly@firefly:~$ sudo apt-get install -y -qq --no-install-recommends docker-ce
Setting up docker-ce (18.06.1~ce~3-0~ubuntu) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2018-10-24 12:39:15 CST; 47ms ago

 Docs: https://docs.docker.com

Process: 9938 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 9938 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

Env:

Board: Firefly ROC-3399-PC-v1.0-A
CPU: Rockchip RK3399
'uname -a ' outputs: Linux firefly 4.4.154 #24 SMP Tue Sep 25 12:47:11 CST 2018 aarch64 aarch64 aarch64 GNU/Linux

Other :

[Installed successfully] 1. Install Kubernetes via opsx.alibaba.com/mirror
[Installed successfully] 2. Install Docker.io via http://ports.ubuntu.com/ubuntu-ports bionic/universe arm64

25F
1696490246985143

Failed to install on an ARM dev board

Reproduction

firefly@firefly:~$ curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

Executing docker install script, commit: 36b78b2
  • sudo -E sh -c 'apt-get update -qq >/dev/null'
  • sudo -E sh -c 'apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null'
  • sudo -E sh -c 'curl -fsSL "https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg" | apt-key add -qq - >/dev/null'
    Warning: apt-key output should not be parsed (stdout is not a terminal)
  • sudo -E sh -c 'echo "deb [arch=arm64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic edge" > /etc/apt/sources.list.d/docker.list'
  • '[' ubuntu = debian ']'
  • sudo -E sh -c 'apt-get update -qq >/dev/null'
  • sudo -E sh -c 'apt-get install -y -qq --no-install-recommends docker-ce >/dev/null'
    E: Sub-process /usr/bin/dpkg returned an error code (1)
Next: Re-type the last command which returned the error code

firefly@firefly:~$ sudo apt-get install -y -qq --no-install-recommends docker-ce
Setting up docker-ce (18.06.1~ce~3-0~ubuntu) ...
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Wed 2018-10-24 12:39:15 CST; 47ms ago

 Docs: https://docs.docker.com

Process: 9938 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
Main PID: 9938 (code=exited, status=1/FAILURE)
dpkg: error processing package docker-ce (--configure):
installed docker-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
docker-ce
E: Sub-process /usr/bin/dpkg returned an error code (1)

Env:

Board: Firefly ROC-3399-PC-v1.0-A
CPU: Rockchip RK3399
'uname -a ' outputs: Linux firefly 4.4.154 #24 SMP Tue Sep 25 12:47:11 CST 2018 aarch64 aarch64 aarch64 GNU/Linux

Other :

[Installed successfully] 1. Install Kubernetes via opsx.alibaba.com/mirror
[Installed successfully] 2. Install Docker.io via http://ports.ubuntu.com/ubuntu-ports bionic/universe arm64

26F
胡作非为

指定安装docker版本无法安装。
[root@master1 ~]# yum install docker-ce-17.03.0.ce-1.el7.centos
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.163.com
  • extras: mirrors.163.com
  • updates: mirrors.163.com
    正在解决依赖关系

--> 正在检查事务
---> 软件包 docker-ce.x86_64.0.17.03.0.ce-1.el7.centos 将被 安装
--> 正在处理依赖关系 docker-ce-selinux >= 17.03.0.ce-1.el7.centos,它被软件包 docker-ce-17.03.0.ce-1.el7.centos.x86_64 需要
软件包 docker-ce-selinux-17.03.3.ce-1.el7.noarch 被已安装的 1:docker-ce-cli-18.09.0-3.el7.x86_64 取代
--> 解决依赖关系完成
错误:软件包:docker-ce-17.03.0.ce-1.el7.centos.x86_64 (docker-ce-stable)

      需要:docker-ce-selinux >= 17.03.0.ce-1.el7.centos
      可用: docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch (docker-ce-stable)
          docker-ce-selinux = 17.03.0.ce-1.el7.centos
      可用: docker-ce-selinux-17.03.1.ce-1.el7.centos.noarch (docker-ce-stable)
          docker-ce-selinux = 17.03.1.ce-1.el7.centos
      可用: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch (docker-ce-stable)
          docker-ce-selinux = 17.03.2.ce-1.el7.centos
      可用: docker-ce-selinux-17.03.3.ce-1.el7.noarch (docker-ce-stable)
          docker-ce-selinux = 17.03.3.ce-1.el7

您可以尝试添加 --skip-broken 选项来解决该问题
您可以尝试执行:rpm -Va --nofiles --nodigest