【Docker】离线一键式安装docker、docker-compose

1.创建根目录(可随意)

shell 复制代码
mkdir -p /docker

2.上传文件

资源地址

shell 复制代码
[root@localhost docker]# tree /docker/
/docker/
├── docker
│   ├── docker-18.03.1-ce.tgz
│   └── docker-compose-Linux-x86_64
├── install-docker-compose.sh
└── install-docker.sh

3.安装

shell 复制代码
# 脚本赋执行权限
chmod +x *.sh
# 安装docker
./install-docker.sh
# 安装docker-compose
./install-docker-compose.sh

操作日志:

shell 复制代码
[root@localhost docker]# chmod +x *.sh
[root@localhost docker]# ls
docker  install-docker-compose.sh  install-docker.sh
[root@localhost docker]#
[root@localhost docker]#
[root@localhost docker]# ./install-docker.sh
 ++++++++   current docker version 3.10   ++++++++
 ++++++++   Can be installed docker   ++++++++
 ++++++++   Start installing Docker   ++++++++
已加载插件:fastestmirror
参数 docker 没有匹配
参数 docker-client 没有匹配
参数 docker-client-latest 没有匹配
参数 docker-common 没有匹配
参数 docker-latest 没有匹配
参数 docker-latest-logrotate 没有匹配
参数 docker-logrotate 没有匹配
参数 docker-engine 没有匹配
不删除任何软件包
 ++++++++   Start install -docker-18.03.1-ce.tgz ,please waiting...   ++++++++
docker/
docker/dockerd
docker/docker-proxy
docker/docker-containerd
docker/docker-runc
docker/docker-init
docker/docker-containerd-shim
docker/docker
docker/docker-containerd-ctr
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service
Wants=network-online.target

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s

[Install]
WantedBy=multi-user.target

 ++++++++   Install success   ++++++++
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /etc/systemd/system/docker.service.
Docker version 18.03.1-ce, build 9ee9f40
 ++++++++   docker restart and join the boot   ++++++++
[root@localhost docker]#
[root@localhost docker]#
[root@localhost docker]# ./install-docker-compose.sh
Start install docker-compose ...
Install docker-compose suceess
docker-compose version 1.24.1, build 4667896b
[root@localhost docker]#
相关推荐
binishuaio几秒前
Java 第11天 (git版本控制器基础用法)
java·开发语言·git
zz.YE2 分钟前
【Java SE】StringBuffer
java·开发语言
老友@2 分钟前
aspose如何获取PPT放映页“切换”的“持续时间”值
java·powerpoint·aspose
wrx繁星点点17 分钟前
状态模式(State Pattern)详解
java·开发语言·ui·设计模式·状态模式
Upaaui20 分钟前
Aop+自定义注解实现数据字典映射
java
zzzgd81620 分钟前
easyexcel实现自定义的策略类, 最后追加错误提示列, 自适应列宽,自动合并重复单元格, 美化表头
java·excel·表格·easyexcel·导入导出
友善的鸡蛋21 分钟前
解决:使用EasyExcel导入Excel模板时出现数据导入不进去的问题
java·easyexcel·excel导入
星沁城22 分钟前
240. 搜索二维矩阵 II
java·线性代数·算法·leetcode·矩阵
NoneCoder34 分钟前
Java企业级开发系列(1)
java·开发语言·spring·团队开发·开发
一只爱好编程的程序猿37 分钟前
Java后台生成指定路径下创建指定名称的文件
java·python·数据下载