目录
1.说明
由于客户环境是内网,无法连接外网安装依赖,所以下面都是使用内网进行安装;
2.离线安装docker
1.去官网下载 docker 安装包,地址为:Index of linux/static/stable/x86_64/;
2.上传,解压;
mkdir -p /home/software
cd /home/software
rz
tar -zxvf docker-20.10.22.tgz
3.移到 /usr/bin;
cp docker/* /usr/bin/
4.将docker注册为service服务;
vim /etc/systemd/system/docker.service
内容如下
[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
5. 启动docker
chmod +x /etc/systemd/system/docker.service
systemctl daemon-reload #加载配置
systemctl start docker #启动Docker
systemctl enable docker.service #设置开机自启
6. 验证
systemctl status docker #查看Docker状态
docker -v #查看Docker版本
3.安装trwebocr
1.制作trwebocr镜像,找一个已安装trwebocr的docker镜像;打包trwebocr
注意此步骤在已有外网环境中安装
docker pull mmmz/trwebocr:latest
mkdir -p /home/dockerload
docker save -o /home/dockerload/trwebocr.tar mmmz/trwebocr:latest
cd /home/dockerload
sz trwebocr.tar
2.上传内网服务器,加载镜像
mkdir -p /home/dockerload
cd /home/dockerload
rz
docker load -i trwebocr.tar
3. 运行镜像
docker run -itd --rm -p 8089:8089 --name trwebocr mmmz/trwebocr:latest
4.访问
http://ip:8089/
完成