目录
- 概述
- 下载
- 解压
- docker 卸载
- docker 安装
- 检查安装环境
- 常用命令
- 结束
概述
docker离线环境安装 20.1.0.12 , centos 7.x
下载
安装包下载
解压
[root@hadoop01 soft]# unzip docker_20_1_0_12.zip
[root@hadoop01 soft]# cd docker_20_1_0_12
[root@hadoop01 docker_20_1_0_12]# ls
docker-20.10.12.tgz docker.service
[root@hadoop01 docker_20_1_0_12]# tar -zxvf ./docker-20.10.12.tgz
docker/
docker/docker-init
docker/docker
docker/containerd-shim
docker/containerd-shim-runc-v2
docker/runc
docker/dockerd
docker/ctr
docker/docker-proxy
docker/containerd
[root@hadoop01 docker_20_1_0_12]#
docker 卸载
[root@hadoop01 docker_20_1_0_12]# yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
已加载插件:fastestmirror
参数 docker 没有匹配
参数 docker-client 没有匹配
参数 docker-client-latest 没有匹配
参数 docker-common 没有匹配
参数 docker-latest 没有匹配
参数 docker-latest-logrotate 没有匹配
参数 docker-logrotate 没有匹配
参数 docker-engine 没有匹配
不删除任何软件包
[root@hadoop01 docker_20_1_0_12]#
docker 安装
安装 docker
并设置成开机 自启动
[root@hadoop01 docker_20_1_0_12]# ls
docker docker-20.10.12.tgz docker.service
[root@hadoop01 docker_20_1_0_12]# cp docker/* /usr/bin/
[root@hadoop01 docker_20_1_0_12]#
[root@hadoop01 docker_20_1_0_12]# cp ./docker.service /usr/lib/systemd/system
[root@hadoop01 docker_20_1_0_12]#
[root@hadoop01 docker_20_1_0_12]# systemctl daemon-reload
[root@hadoop01 docker_20_1_0_12]# systemctl start docker
[root@hadoop01 docker_20_1_0_12]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@hadoop01 docker_20_1_0_12]#
检查安装环境
以下检查 docker 是否安装成功,如下状态就是成功的。
[root@hadoop01 docker_20_1_0_12]# 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 三 2023-11-08 10:05:36 CST; 35s ago
Docs: https://docs.docker.com
Main PID: 3012 (dockerd)
CGroup: /system.slice/docker.service
├─3012 /usr/bin/dockerd
└─3024 containerd --config /var/run/docker/containerd/containerd.toml --log-level info
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.787687550+08:00" level=info msg="scheme \"unix\" not registered, fallback to default scheme" module=grpc
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.787712219+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///var/run/docke...module=grpc
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.787721552+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.817475097+08:00" level=info msg="Loading containers: start."
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.905046010+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0....IP address"
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.934303295+08:00" level=info msg="Loading containers: done."
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.949475568+08:00" level=info msg="Docker daemon" commit=459d0df graphdriver(s)=overlay2 version=20.10.12
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.949544835+08:00" level=info msg="Daemon has completed initialization"
11月 08 10:05:36 hadoop01 systemd[1]: Started Docker Application Container Engine.
11月 08 10:05:36 hadoop01 dockerd[3012]: time="2023-11-08T10:05:36.964474134+08:00" level=info msg="API listen on /var/run/docker.sock"
Hint: Some lines were ellipsized, use -l to show in full.
[root@hadoop01 docker_20_1_0_12]#
常用命令
docker 安装相关的命令,如下表:
命令 | 作用 |
---|---|
systemctl start docker | 启动 |
systemctl stop docker | 停止 |
systemctl status docker | 查看状态 |
结束
docker 至此安装结束,如有问题,欢迎评论区留言。