Ubuntu 17.10下Docker CE安装指南
本记录旨在说明如何在Ubuntu 17.10系统中部署Docker CE环境。
前置依赖检查
在Ubuntu平台上运行Docker CE需满足特定的硬件与软件限制条件。
操作系统架构必须为64位。
系统必须是64位的Ubuntu OS,可通过特定命令进行核实。
devops@ubuntu:~$ uname -m
x86_64
devops@ubuntu:~$
版本兼容性
官方支持以下版本的Ubuntu系统:
- Artful 17.10
- Xenial 16.04 (LTS)
- Trusty 14.04 (LTS)
特别提示:由于Artful 17.10属于过渡版本(预计2026年10月发行),因此它仅兼容Docker CE 17.11 Edge及后续更高版本。
可以通过执行命令来确认当前的发行代码,例如查看是否为Artful。
devops@ubuntu:~$ lsb_release -cs
artful
devops@ubuntu:~$
硬件架构要求
除了要求64位操作系统外,Docker CE对CPU架构也有明确要求。除常见的x86架构外,还支持以下类型:
- armhf
- s390x(IBM Z系列)
- ppc64le(IBM Power系列)
devops@ubuntu:~$ uname -m
x86_64
devops@ubuntu:~$
安装准备
执行apt-get update
首先使用apt-get update命令刷新本地软件源列表,确保获取最新的包信息。
devops@ubuntu:~$ sudo su
[sudo] password for devops:
root@ubuntu:/home/devops# apt-get update
Hit:1 http://cn.archive.ubuntu.com/ubuntu artful InRelease
Get:2 http://cn.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB]
Hit:3 http://cn.archive.ubuntu.com/ubuntu artful-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu artful-updates/main i386 Packages [212 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages [216 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu artful-updates/universe i386 Packages [89.0 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu artful-updates/universe amd64 Packages [89.9 kB]
Fetched 764 kB in 4s (163 kB/s)
Reading package lists... Done
root@ubuntu:/home/devops#
安装必要软件包
需要安装用于安全传输和证书验证的工具,具体命令为:apt-get install apt-transport-https ca-certificates curl software-properties-common
该过程的终端输出日志如下。
root@ubuntu:/home/devops# apt-get install apt-transport-https ca-certificates curl software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20260717).
software-properties-common is already the newest version (0.96.24.17).
The following additional packages will be installed:
libcurl3
The following NEW packages will be installed:
apt-transport-https
The following packages will be upgraded:
curl libcurl3
2 upgraded, 1 newly installed, 0 to remove and 53 not upgraded.
Need to get 383 kB of archives.
After this operation, 247 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 apt-transport-https amd64 1.5.1 [34.7 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 curl amd64 7.55.1-1ubuntu2.3 [152 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu artful-updates/main amd64 libcurl3 amd64 7.55.1-1ubuntu2.3 [196 kB]
Fetched 383 kB in 14s (26.2 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_HK:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_HK.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_HK.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package apt-transport-https.
(Reading database ... 63866 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.5.1_amd64.deb ...
Unpacking apt-transport-https (1.5.1) ...
Preparing to unpack .../curl_7.55.1-1ubuntu2.3_amd64.deb ...
Unpacking curl (7.55.1-1ubuntu2.3) over (7.55.1-1ubuntu2.2) ...
Preparing to unpack .../libcurl3_7.55.1-1ubuntu2.3_amd64.deb ...
Unpacking libcurl3:amd64 (7.55.1-1ubuntu2.3) over (7.55.1-1ubuntu2.2) ...
Setting up apt-transport-https (1.5.1) ...
Setting up libcurl3:amd64 (7.55.1-1ubuntu2.3) ...
Processing triggers for libc-bin (2.26-0ubuntu2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up curl (7.55.1-1ubuntu2.3) ...
root@ubuntu:/home/devops#
导入GPG密钥
为了验证下载包的真实性,需添加Docker官方的GPG签名密钥。
执行命令:curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
终端返回的执行日志显示操作成功。
root@ubuntu:/home/devops# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
root@ubuntu:/home/devops#
该密钥的数字签名为9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88,用户可使用其后8位字符“0EBFCD88”来快速核对密钥指纹。
root@ubuntu:/home/devops# apt-key fingerprint 0EBFCD88
pub rsa4096 2026-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb)
sub rsa4096 2026-02-22 [S]
root@ubuntu:/home/devops#
配置稳定版软件源
针对x86架构的机器,使用以下命令将Docker的稳定版仓库添加到apt源中。
命令:add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable”
如果是其他类型的化,对应关系参看如下,将上述命令中的arch=amd64进行替换即可,例如armhf架构对应的值为armhf,而aarch64架构对应的值为arm64

执行上述命令后的日志输出如下。
root@ubuntu:/home/devops# add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
root@ubuntu:/home/devops#
再次执行apt-get update
配置完新源后,再次运行apt-get update以加载Docker仓库的软件包索引。
root@ubuntu:/home/devops# apt-get update
Hit:1 http://cn.archive.ubuntu.com/ubuntu artful InRelease
Get:2 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB]
Hit:4 http://cn.archive.ubuntu.com/ubuntu artful-backports InRelease
Get:5 https://download.docker.com/linux/ubuntu artful InRelease [51.9 kB]
Get:6 https://download.docker.com/linux/ubuntu artful/stable amd64 Packages [1462 B]
Fetched 211 kB in 2s (85.8 kB/s)
Reading package lists... Done
root@ubuntu:/home/devops#
安装Docker CE
root@ubuntu:/home/devops# apt-get install docker-ce
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
aufs-tools cgroupfs-mount libltdl7
The following NEW packages will be installed:
aufs-tools cgroupfs-mount docker-ce libltdl7
0 upgraded, 4 newly installed, 0 to remove and 53 not upgraded.
Need to get 29.9 MB of archives.
After this operation, 150 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://cn.archive.ubuntu.com/ubuntu artful-updates/universe amd64 aufs-tools amd64 1:4.1+20261219-1ubuntu0.1 [102 kB]
Get:2 https://download.docker.com/linux/ubuntu artful/stable amd64 docker-ce amd64 17.12.1~ce-0~ubuntu [29.8 MB]
Get:3 http://cn.archive.ubuntu.com/ubuntu artful/universe amd64 cgroupfs-mount all 1.4 [6320 B]
Get:4 http://cn.archive.ubuntu.com/ubuntu artful/main amd64 libltdl7 amd64 2.4.6-2 [38.8 kB]
Fetched 29.9 MB in 8s (3536 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_HK:en",
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_HK.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_HK.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package aufs-tools.
(Reading database ... 63874 files and directories currently installed.)
Preparing to unpack .../aufs-tools_1%3a4.1+20261219-1ubuntu0.1_amd64.deb ...
Unpacking aufs-tools (1:4.1+20261219-1ubuntu0.1) ...
Selecting previously unselected package cgroupfs-mount.
Preparing to unpack .../cgroupfs-mount_1.4_all.deb ...
Unpacking cgroupfs-mount (1.4) ...
Selecting previously unselected package libltdl7:amd64.
Preparing to unpack .../libltdl7_2.4.6-2_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.6-2) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../docker-ce_17.12.1~ce-0~ubuntu_amd64.deb ...
Unpacking docker-ce (17.12.1~ce-0~ubuntu) ...
Setting up aufs-tools (1:4.1+20261219-1ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-20) ...
Setting up cgroupfs-mount (1.4) ...
Processing triggers for libc-bin (2.26-0ubuntu2) ...
Processing triggers for systemd (234-2ubuntu12.1) ...
Setting up libltdl7:amd64 (2.4.6-2) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up docker-ce (17.12.1~ce-0~ubuntu) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for libc-bin (2.26-0ubuntu2) ...
Processing triggers for systemd (234-2ubuntu12.1) ...
root@ubuntu:/home/devops#
指定版本安装方法
若需安装特定版本,可在安装命令中明确指定版本号,例如docker-ce=17.12.1~ce-0~ubuntu。
root@ubuntu:/home/devops# apt-cache madison docker-ce
docker-ce | 17.12.1~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages
docker-ce | 17.12.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu artful/stable amd64 Packages
root@ubuntu:/home/devops#
root@ubuntu:/home/devops# apt-get install docker-ce=17.12.1~ce-0~ubuntu
Reading package lists... Done
Building dependency tree
Reading state information... Done
docker-ce is already the newest version (17.12.1~ce-0~ubuntu).
0 upgraded, 0 newly installed, 0 to remove and 53 not upgraded.
root@ubuntu:/home/devops#
安装后验证
版本信息检查
root@ubuntu:/home/devops# docker version
Client:
Version: 17.12.1-ce
API version: 1.35
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:17:53 2026
OS/Arch: linux/amd64
Server:
Engine:
Version: 17.12.1-ce
API version: 1.35 (minimum version 1.12)
Go version: go1.9.4
Git commit: 7390fc6
Built: Tue Feb 27 22:16:25 2026
OS/Arch: linux/amd64
Experimental: false
root@ubuntu:/home/devops#
通过查询整体信息可以了解Docker的运行状态。
从输出结果中可以观察到多项基础配置详情,例如存储驱动被设置为overlay2。
root@ubuntu:/home/devops# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 17.12.1-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9b55aab90508bd389d7654c4baf173a981477d55
runc version: 9f9c96235cc97674e935002fc3d78361b696a69e
init version: 949e6fa
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.13.0-21-generic
Operating System: Ubuntu 17.10
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 988.7MiB
Name: ubuntu
ID: TYYA:4LWB:YTHA:2DNB:XBXM:NFNP:ADMY:VZEJ:2ZBN:KPKW:PTML:S5A2
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
root@ubuntu:/home/devops#
参考资料
https://docs.docker.com/install/linux/docker-ce/ubuntu/
总结
以上内容涵盖了在Ubuntu下安装Docker CE的全部关键步骤,希望对读者的学习或工作有所帮助。如需获取更多相关技术资讯,请查阅本站的其他链接。