本文出自http://www.cnblogs.com/scoter2008
1、强大的官方文档
1
|
https:
//docs
.docker.com
/engine/installation/linux/centos/
|
2、按步骤来,先更新yum源,这里用163的源
1
2
3
4
@H_404_46@
5
6
|
yum
install
-y wget
cd
/etc/yum
.repos.d
wget http:
//mirrors
.163.com/.help
/CentOS7-Base-163
.repo
/usr/bin/yum
clean all
/usr/bin/yum
makecache
其他系统自带的源可以保留,也可以全部干掉
|
3、更新系统
1
|
yum update
|
4、如果遇到问题:Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
1
|
yum
install
-y deltarpm
|
1
2
3
4
@H_404_46@
5
6
7
8
|
tee
/etc/yum
.repos.d
/docker
.repo <<-
'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https:
//yum
.dockerproject.org
/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https:
//yum
.dockerproject.org
/gpg
EOF
|
6、安装Docker
1
|
yum
install
docker-engine
|
7、如果遇到问题:Public key for docker-engine-selinux-1.10.1-1.el7.centos.noarch.rpm is not installed,执行下面的命令
1
|
rpm --
import
https:
//yum
.dockerproject.org
/gpg
|
8、Docker下载速度很慢,请耐心等待
9、安装完成后设置开机自启
1
|
systemctl
enable
docker.service
|
10、启动docker守护进程
1
|
systemctl start docker
|
11、查看docker版本
1
2
3
4
@H_404_46@
5
6
7
8
9
10
11
12
13
14
15
16
|
[root@localhost ~]
# docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built:
OS
/Arch
: linux
/amd64
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built:
OS
/Arch
: linux
/amd64
|
12、 Done,enjoy it!
原文链接:https://www.f2er.com/centos/376111.html