【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]#
相关推荐
呼啦啦啦啦啦啦啦啦1 小时前
常见的排序算法
java·算法·排序算法
anlogic2 小时前
Java基础 8.18
java·开发语言
练习时长一年2 小时前
AopAutoConfiguration源码阅读
java·spring boot·intellij-idea
源码宝3 小时前
【智慧工地源码】智慧工地云平台系统,涵盖安全、质量、环境、人员和设备五大管理模块,实现实时监控、智能预警和数据分析。
java·大数据·spring cloud·数据分析·源码·智慧工地·云平台
David爱编程4 小时前
面试必问!线程生命周期与状态转换详解
java·后端
LKAI.5 小时前
传统方式部署(RuoYi-Cloud)微服务
java·linux·前端·后端·微服务·node.js·ruoyi
HeyZoeHey5 小时前
Mybatis执行sql流程(一)
java·sql·mybatis
2301_793086875 小时前
SpringCloud 07 微服务网关
java·spring cloud·微服务
柳贯一(逆流河版)6 小时前
Spring 三级缓存:破解循环依赖的底层密码
java·spring·缓存·bean的循环依赖
__lll_7 小时前
手把手教你用 Docker 部署 Vue 项目(含国内镜像加速 + 踩坑指南)
docker