阜阳网站建设价格低,零遁nas做网站,wordpress怎么收费,广州品牌网站设计建设最简单的Docker离线安装教程 方式一 RPM 包方式1. 在线下载 RPM 包2. 将 RPM 包拷贝到安装机器3. 安装4. 启动 方式二 二进制安装方式#xff08;推荐#xff09;1. 下载包2. 将包进行解压授权3. 注册 systemd4. 自启和启动 一直以来在线安装 docker 到服务器上是非常方便的推荐1. 下载包2. 将包进行解压授权3. 注册 systemd4. 自启和启动 一直以来在线安装 docker 到服务器上是非常方便的但是经常会遇到服务器无法直接通互联网因为需要我们离线安装。本文提供两种离线安装的方式。
方式一 RPM 包方式
1. 在线下载 RPM 包
先找一台可以连接互联网的电脑下载 RPM 包电脑的版本最好和要安装的服务器版本一致。执行如下步骤
下载RPM包方式安装RPM包方式
# 安装
yum install -y yum-utils# 配置 yum docker 源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast# 下载rpm包包括依赖都会下载
yumdownloader --resolve --downloadonly docker-ce-19.03.9 docker-ce-cli-19.03.9 docker-compose \
audit audit-libs audit-libs-python containerd.io container-selinux libcgroup python-IPy \
setools-libs checkpolicy libsemanage-python policycoreutils2. 将 RPM 包拷贝到安装机器
怎么拷贝都行将RPM 包放到服务器的某一个目录就行
3. 安装
# 将 rpm 包安装
rpm -ivh --replacefiles --replacepkgs *.rpm4. 启动
systemctl enable docker systemctl start docker后面使用跟在线安装一样了方式二 二进制安装方式推荐
1. 下载包
去官方地址下载 docker 包 https://docs.docker.com/engine/install/binaries/
2. 将包进行解压授权
# 解压
tar -zxvf docker-19.03.9.tgz --strip-components1 --directory /usr/bin/# 文件授权
chown root:root /usr/bin/containerd /usr/bin/containerd-shim /usr/bin/ctr /usr/bin/docker /usr/bin/dockerd /usr/bin/docker-init /usr/bin/docker-proxy /usr/bin/runc3. 注册 systemd
cat /etc/systemd/system/docker.service EOF
[Unit]
DescriptionDocker Application Container Engine
Documentationhttps://docs.docker.com
Afternetwork-online.target firewalld.service
Wantsnetwork-online.target[Service]
Typenotify
# 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.
LimitNOFILEinfinity
LimitNPROCinfinity
LimitCOREinfinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMaxinfinity
TimeoutStartSec0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegateyes
# kill only the docker process, not all processes in the cgroup
KillModeprocess
# restart the docker process if it exits prematurely
Restarton-failure
StartLimitBurst3
StartLimitInterval60s[Install]
WantedBymulti-user.target
EOF4. 自启和启动
启动
systemctl daemon-reload systemctl enable docker systemctl start docker