千家信息网

CentOS 7.5.1804 安装配置docker

发表于:2024-11-25 作者:千家信息网编辑
千家信息网最后更新 2024年11月25日,1、 CentOS 7.5.1804 系统最小化安装,此处省略;[root@docker01 ~]# uname -aLinux docker01 3.10.0-862.el7.x86_64 #1 S
千家信息网最后更新 2024年11月25日CentOS 7.5.1804 安装配置docker

1、 CentOS 7.5.1804 系统最小化安装,此处省略;
[root@docker01 ~]# uname -a
Linux docker01 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@docker01 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@docker01 ~]#

2、 修改系统默认系统软件包安装源为阿里云镜像仓库;
 备份默认的源配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
 下载新的CentOS-Base.repo 到/etc/yum.repos.d
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、 更新系统软件包;
[root@docker01 ~]# yum update -y

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

5、 校验;
[root@docker01 ~]# docker version
Client:
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:48:22 2018
OS/Arch: linux/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:19:08 2018
OS/Arch: linux/amd64
Experimental: false
[root@docker01 ~]# docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: 18.09.0
Storage Driver: overlay2
Backing Filesystem: xfs
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 local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: c4446665cb9c30056f4998ed953e6d4ff22c7c39
runc version: 4fc53a81fb7c994640722ac585fa9ca548971871
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.0-862.14.4.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.936GiB
Name: docker01
ID: J4S2:R5XK:AVDU:U3DO:XRPU:NXV5:WIHR:INN2:KFFN:N7NJ:HSNN:RGRR
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
Product License: Community Engine

6、 完成。

0