同步操作将从 舒磊/openoffice4-daemon 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Image running the OpenOffice 4 soffice daemon service, and solve the problem of Chinese code scrambling.(包括中文乱码问题)
This image was created following the https://github.com/rafaeltuelho/openoffice3-daemon. And thanks he
docker build --pull -t xiaojun207/openoffice4-daemon --build-arg OO_VERSION=4.1.7 .
docker run -d -u 123456 --name soffice -p 8100:8100 -v /data/:/data/ xiaojun207/openoffice4-daemon:latest
When you run this image the container will start the Openoffice daemon in headless mode listening on TCP port 8100
by default. To change this port pass the env var SOFFICE_DAEMON_PORT
If you use java, you can use jodconverter connect the container, like this:
import java.io.File;
import java.io.FileNotFoundException;
import lombok.extern.slf4j.Slf4j;
import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
import org.artofsolving.jodconverter.office.OfficeManager;
...
public static void main(String[] args){
DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
configuration.setOfficeHome("/opt/openoffice4");
configuration.setPortNumbers(8100);
configuration.setTaskExecutionTimeout(1000 * 60 * 5L);// 设置任务执行超时为5分钟
configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);// 设置任务队列超时为24小时
OfficeManager officeManager = configuration.buildOfficeManager();
String inputFile = "/data/a.docx";
String pdfFile = "/data/a.pdf"; // 注意输出目录的docker写入权限,否则可能会失败
System.out.println("进行文档转换转换:" + inputFile + " --> " + pdfFile + ",isRunning:" + officeManager.isRunning());
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
converter.convert(new File(inputFile), new File(pdfFile));
}
docker exec -it soffice test
unoconv
The unoconv
utility is available in this image! You can test a PDF conversion as follow:
.odt
or .doc
files into a dir (eg: ~/pdfs
) in your host.docker run \
-v ~/pdfs:/pdfs:rw \
xiaojun207/openoffice4-daemon \
unoconv --connection 'socket,host=127.0.0.1,port=8100,tcpNoDelay=1;urp;StarOffice.ComponentContext' \
-f pdf /pdfs/somefile.doc
.pdf
inside the dir mounted as VolumeImageStream
oc import-image openoffice4-daemon --from=docker.io/xiaojun207/openoffice4-daemon --confirm --scheduled
DeploymentConfig
to include the soffice
container inside your App POD
...
spec:
containers:
- image: >-
docker.io/xiaojun207/openoffice4-daemon@sha256:<image tag sha256>
imagePullPolicy: Always
name: soffice
ports:
- containerPort: 8100
protocol: TCP
...
test: false
triggers:
- imageChangeParams:
automatic: true
containerNames:
- soffice
from:
kind: ImageStreamTag
name: 'openoffice4-daemon:latest'
namespace: demo-tomcat6
lastTriggeredImage: >-
docker.io/xiaojun207/openoffice4-daemon@sha256:<image tag sha256>
type: ImageChange
...
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。