【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]#
相关推荐
计算机毕设指导6几秒前
基于 SpringBoot 的作业管理系统【附源码】
java·vue.js·spring boot·后端·mysql·spring·intellij-idea
Gu Gu Study2 分钟前
枚举与lambda表达式,枚举实现单例模式为什么是安全的,lambda表达式与函数式接口的小九九~
java·开发语言
Chris _data5 分钟前
二叉树oj题解析
java·数据结构
牙牙70510 分钟前
Centos7安装Jenkins脚本一键部署
java·servlet·jenkins
paopaokaka_luck18 分钟前
[371]基于springboot的高校实习管理系统
java·spring boot·后端
以后不吃煲仔饭30 分钟前
Java基础夯实——2.7 线程上下文切换
java·开发语言
进阶的架构师31 分钟前
2024年Java面试题及答案整理(1000+面试题附答案解析)
java·开发语言
The_Ticker37 分钟前
CFD平台如何接入实时行情源
java·大数据·数据库·人工智能·算法·区块链·软件工程
大数据编程之光1 小时前
Flink Standalone集群模式安装部署全攻略
java·大数据·开发语言·面试·flink
爪哇学长1 小时前
双指针算法详解:原理、应用场景及代码示例
java·数据结构·算法