前言:
现时朋友们对“javaopenoffice”大体比较注意,小伙伴们都想要知道一些“javaopenoffice”的相关知识。那么小编也在网摘上搜集了一些对于“javaopenoffice””的相关文章,希望你们能喜欢,各位老铁们快快来了解一下吧!应用场景
1.实现一个容器中运行多个进程
2.应用与一个容器中的一个程序依赖另一个应用程序,需要将多个程序制作在一个镜像中
实现技术方法dockerfiledockersupervisoropenofficetomcat服务(jar包)openoffice下载
下载地址如下:
官网:
官方安装包下载地址:
非docker安装官方示例:
注意问题:
依赖包: yum install libXext.x86_64 && yum -y groupinstall "X Window System"
supervisor安装
基于centos服务器
yum install supervisor
配置文件准备:
supervisord.conf(可根据自己实际情况进行添加)
[unix_http_server]file=/var/run/supervisor/supervisor.sock ; (the path to the socket file)[supervisord]logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)logfile_backups=10 ; (num of main logfile rotation backups;default 10)loglevel=info ; (log level;default info; others: debug,warn,trace)user=rootpidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)nodaemon=true ; (start in foreground if true;default false)minfds=1024 ; (min. avail startup file descriptors;default 1024)minprocs=200 ; (min. avail process descriptors;default 200)[rpcinterface:supervisor]supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface[supervisorctl]serverurl=unix:///var/run/supervisor/supervisor.sock ; use a unix:// URL for a unix socket[program:openoffice]directory=/opt/openoffice4/programcommand=soffice -headless -accept="socket,host=0.0.0.0,port=8100;urp;" -nofirststartwizardautostart=truestartsecs=60autorestart=truestartretries=3user=rootredirect_stderr=true[program:test-system]directory=/optcommand=java -server -Djava.security.egd=file:/dev/./urandom -jar /opt/test.jarautostart=truestartsecs=120autorestart=truestartretries=3user=rootredirect_stderr=true
Dockerfile镜像制作
dockerfile文件如下:
FROM test/dev/centos-oracle-java8:v1.0.1 //centos基本镜像带有jdk的业务版本MAINTAINER wade.qu <wade.qu@fosun.comENV LANG=en_US.UTF-8RUN yum -y install epel-release && yum clean all && yum install -y supervisor tzdata libXext.x86_64 && yum -y groupinstall "X Window System"\ && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ && echo "Asia/Shanghai" > /etc/timezoneARG appnameARG jarnameENV appname ${appname}#USER jpaas#工作目录WORKDIR /opt#暴露端口EXPOSE 7009ADD Apache_OpenOffice_4.1.14_Linux_x86-64_install-rpm_zh-CN.tar.gz .COPY supervisord.conf /etc/supervisord.confCOPY libXext.so.6 /opt/openoffice4/program/RUN yum makecache && yum -y localinstall zh-CN/RPMS/*.rpm && yum -y localinstall zh-CN/RPMS/desktop-integration/openoffice4.1.14-redhat-menus-4.1.14-9811.noarch.rpm && mkdir -p /opt/filedata && rm -fr zh-CNADD ${jarname} /opt/${appname}.jarCMD ["/usr/bin/supervisord","-c","/etc/supervisord.conf"]
制作镜像
docker build --build-arg appname="服务名称" --build-arg jarname="jar包名称" -t testdev/test:1.1.8 .
完成
标签: #javaopenoffice