Openfire service packaged with Dockerfile mirror

Recently took over a container of cloud operation and maintenance project and a data governance platform construction projects, both companies belong to a country prefix of key construction projects. This container cloud projects mainly rely Kubernets cluster to manage docker business image.
About bale docker business image, the project mainly docker-build script to call dockerfile complete package docker mirrored by the business. Although the project has related sources can prepare profiles on plug-permanent storage container to achieve business docker "that is deploying Configuration", fully automated installation and deployment and configuration of business applications. In fact, this approach does not always work, when I can say that according to wiki documents he provided to operate, without success fully automated, "that is deployed configuration" type of installation to deploy and configure business applications.
By the relevant data query Dockerfile found CMD command shell scripts do is support parameters, so viable approach is docker mirror and shell script used in conjunction with, rather than with the use and configuration files.
In a packed Openfire service "deployment to use" automated deployment configuration as an example:
In this project, openfire want to use MySQL as the data storage media account information, feasible idea is to create a MySQL database account information required to initialize and sql file after the authorization sql file, specify the Docker startup shell script to run MySQL sql file to achieve the automatic initialization and setup, to automate the deployment "deploy to use" configuration goal is to deploy and run docker image to the client by Spark direct register a new account and log in and use Openfire service, avoiding the manual deployment when the initial configuration of Openfire services.

openfire of dockerfile follows, until I finished the experiment at leisure and then supplemented with MySQL MySQL automation trouble setting initialization dockerfile:

This is a openfire Dockerfile

Version 2.0

Base images base image

FROM centos

#MAINTAINER maintainer information
MAINTAINER PomengTeng
#add file in the current directory, the archive copy past will automatically extract
the ADD Openfire-4.5.1-1.x86_64.rpm / the TEMP
the ADD DK-Linux-x64.rpm / the TEMP

#RUN 执行以下命令
RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && yum clean all && yum makecache
RUN yum install -y gcc gcc-c++ make openssl-devel pcre-devel pcre && yum clean all

#WORKDIR 相当于cd
WORKDIR /temp
RUN yum localinstall jdk-linux-x64.rpm
RUN yum localinstall openfire-4.5.1-1.x86_64.rpm
RUN export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre
RUN export PATH=$PATH:$JAVA_HOME/bin

#EXPOSE port mapping
EXPOSE 9000

#CMD run the following command
CMD [ "/opt/openfire/bin/openfire.sh"]

Guess you like

Origin blog.51cto.com/6286393/2485649