红联Linux门户
Linux帮助

在Ubuntu 16.04操作系统中安装Docker的方法

发布时间:2016-05-28 09:46:37来源:linux网站作者:ccskun

1、更改apt源,更改前先对sources.list文件进行备分

ccskun@test:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改sources.list文件:

sudo gedit /etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

更新apt源:

ccskun@test:~$ sudo apt-get update


2、安装Docker

ccskun@test:~$ sudo apt-get install docker.io

安装完成后,需要重启下系统。

sudo reboot


3、验证

ccskun@test:~$ sudo docker info
Containers: 0
Images: 0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 0
Dirperm1 Supported: true
Execution Driver: native-0.2
Kernel Version: 4.4.0-22-generic
Operating System: Ubuntu 16.04 LTS (containerized)
CPUs: 4
Total Memory: 3.842 GiB
Name: test
ID: H6MK:VMBX:ARD3:R4GN:VMVW:WHPW:AM35:JYVZ:QVYV:2L4M:AWCQ:QOPJ
WARNING: No swap limit support
ccskun@test:~$


本文永久更新地址:http://www.linuxdiyf.com/linux/21013.html