文章目录
- 前言
- 1. 安装Docker容器
- 2. 拉取镜像
- 3. 验证
前言
docker 离线安装onlyoffice,如在线安装可直接跳过导出导入镜像步骤,拉取后直接运行。
1. 安装Docker容器
- 下载文件
wget https://download.docker.com/linux/static/stable/x86_64/docker-19.03.9.tgz
- 解压
把压缩文件存在指定目录下,并进行解压
tar -xvf docker-19.03.6.tgz
- 将解压出来的docker文件内容移动到 /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 -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock
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、启动
systemctl daemon-reload
#重载unit配置文件
systemctl start docker
#启动Docker
systemctl enable docker.service
#设置开机自启
2. 拉取镜像
- 搞个vmware,安装docker后执行
docker pull onlyoffice/documentserver
- 导出镜像
- 查看要导出的镜像
docker images
- 导出到当前所在目录
docker save 【镜像id】 -o onlyoffice.tar
- 查看要导出的镜像
- 导入到目标服务器
docker load -i onlyoffice.tar
- 启动
docker run -i -t -d -p 80:80 --restart=always 【镜像id】
此时拉取的是最新版本,docker inspect 不显示版本号,经查询该版本可能是7.4.1 下载 ONLYOFFICE Docs | ONLYOFFICE
3. 验证
浏览器访问服务器ip即可 例如:http://172.17.10.136/