- 按照docker要求系统为64位,系统内核版本为3.10以上,使用此命令查询
[root@localhost ~]# uname -r
3.10.0-1160.118.1.el7.x86_64
- 查看是否已安装docker列表
[root@localhost ~]# yum list installed | grep docker
- 安装docker
[root@localhost ~]# yum -y install docker
- 手动启动docker
[root@localhost ~]# systemctl start docker
- 查看docker状态
[root@localhost ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2024-06-04 13:43:05 CST; 31min ago
Docs: http://docs.docker.com
Main PID: 4791 (dockerd-current)
Tasks: 49
Memory: 11.0M
CGroup: /system.slice/docker.service
├─4791 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt ...
├─4799 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeo...
├─5098 /usr/libexec/docker/docker-proxy-current -proto tcp -host-ip 0.0.0.0 -host-port 18630 -container-ip 172.17.0.2 -container-port 18630...
└─5105 /usr/bin/docker-containerd-shim-current f34dd9057953cd36f9548c77ff0ec413a40c75ed3be69a46f6a55e4477615565 /var/run/docker/libcontaine...
- 配置阿里云镜像加速
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://01sy6s7g.mirror.aliyuncs.com"]
}
EOF
# 刷新系统服务
systemctl daemon-reload
# 重启docker服务
systemctl restart docker
- 设置docker开机自动启动
[root@localhost streamsets]# systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.