Date: Thu, 28 Mar 2024 13:23:26 +0000 (UTC) Message-ID: <15246780.11473.1711632206788@change.sos-berlin.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_11472_1352345188.1711632206788" ------=_Part_11472_1352345188.1711632206788 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The following files are required for the build context:
Dockerfile
joc_install.xml
with individu=
al installation settings. A template of this file is available when extract=
ing the installer tarball.start_joc.sh
Download: Dockerfile
FROM openjdk:8 LABEL maintainer=3D"Software- und Organisations-Service GmbH" # default user id has to match later run-time user ARG USER_ID=3D$UID # provide build arguments for release information ARG JS_MAJOR=3D1.13 ARG JS_RELEASE=3D1.13.3 # add installer archive file COPY joc_linux.${JS_RELEASE}.tar.gz /usr/local/src/ RUN test -e /usr/local/src/joc_linux.${JS_RELEASE}.tar.gz && \ tar zxvf /usr/local/src/joc_linux.${JS_RELEASE}.tar.gz -C /usr/local/sr= c/ && \ rm -f /usr/local/src/joc_linux.${JS_RELEASE}.tar.gz && \ ln -s /usr/local/src/joc.${JS_RELEASE} /usr/local/src/joc # for JDK < 12, /dev/random does not provide sufficient entropy, see htt= ps://kb.sos-berlin.com/x/lIM3 RUN rm /dev/random && ln -s /dev/urandom /dev/random # copy installer response file and run installer COPY joc_install.xml /usr/local/src/joc/ RUN /usr/local/src/joc/setup.sh -u /usr/local/src/joc/joc_install.xml # make default user the owner of directories RUN groupadd --gid ${USER_ID:-1000} jobscheduler && \ useradd --uid ${USER_ID:-1000} --gid jobscheduler --home-dir /home/jobs= cheduler --no-create-home --shell /bin/bash jobscheduler && \ chown -R jobscheduler:jobscheduler /var/sos-berlin.com # copy and prepare start script COPY start_joc.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/start_joc.sh # create volumes for data persistence=20 # VOLUME /var/sos-berlin.com/joc # allow incoming traffic to port EXPOSE 4446=20 # run-time user, can be overwritten when running the container USER jobscheduler CMD ["/usr/local/bin/start_joc.sh"]
Download: joc_inst=
all.xml
<?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"no"?> <!--=20 XML configuration file for JOC If you call the installer with this XML file then=20 you accept at the same time the terms of the=20 licence agreement under GNU GPL 2.0 License=20 (see http://www.gnu.org/licenses/gpl-2.0.html) --> <AutomatedInstallation langpack=3D"eng"> <com.izforge.izpack.panels.UserInputPanel id=3D"home"> <userInput/> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.HTMLLicencePanel id=3D"gpl_licence"/> <com.izforge.izpack.panels.TargetPanel id=3D"target"> =20 <!-- SELECT THE INSTALLATION PATH It must be absolute!=20 For example: /opt/sos-berlin.com/joc on Linux C:\Program Files\sos-berlin.com\joc on Windows --> <installpath>/opt/sos-berlin.com/joc</installpath> =20 </com.izforge.izpack.panels.TargetPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"jetty"> <userInput> =20 <!-- JOC requires a servlet container such as Jetty.=20 If a servlet container already installed then you can use = it.=20 Otherwise a Jetty will be installed in addition if withJet= tyInstall=3Dyes. You need root permissions to install JOC with Jetty. -->= ; <entry key=3D"withJettyInstall" value=3D"yes"/> <entry key=3D"jettyPort" value=3D"4446"/> <!-- Specify the name of the Windows service or Linux Daemon= (default: joc). Only necessary for multiple instances of JOC on one server= . It must be=20 unique per server. This entry is deactivated by a comment = because it MUST NOT BE CHANGED DURING OVER-INSTALLATION! --> <!-- <entry key=3D"jettyServiceName" value=3D"joc"/> --> <!-- Only necessary for Windows --> <entry key=3D"jettyStopPort" value=3D"40446"/> <!-- Only necessary for Unix (root permissions required) --&= gt; <entry key=3D"withJocInstallAsDaemon" value=3D"yes"/> <!-- To enter a JOC User (default=3Dcurrent User).=20 For Unix only (root permissions required)!!! --> <entry key=3D"runningUser" value=3D""/> <!-- Path to Jetty base directory=20 For example: /home/[user]/sos-berlin.com/joc/jetty_base on Linux C:\ProgramData\sos-berlin.com\joc\jetty_base on Windows --= > <entry key=3D"jettyBaseDir" value=3D"/var/sos-berlin.com/joc= "/> <!-- Choose (yes or no) wether the JOC's Jetty should be (re= )started at the end of the installation --> <entry key=3D"launchJetty" value=3D"no"/> =20 <!-- Java options for Jetty. --> <!-- Initial memory pool (-Xms) in MB --> <entry key=3D"jettyOptionXms" value=3D"128"/> <!-- Maximum memory pool (-Xmx) in MB --> <entry key=3D"jettyOptionXmx" value=3D"512"/> <!-- Thread stack size (-Xss) in KB --> <entry key=3D"jettyOptionXss" value=3D"4000"/> <!-- Further Java options --> <entry key=3D"jettyOptions" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"reportingDatabase"&g= t; <userInput> <!-- Reporting Database Configuration --> =20 <!-- Database connection settings can be specified with foll= owing entries such as databaseHost, databasePort, ... or by a hibernate configur= ation file=20 Posible values are 'withoutHibernateFile' (default) and 'w= ithHibernateFile'. --> <entry key=3D"reporting.databaseConfigurationMethod" value= =3D"withoutHibernateFile"/> =20 <!-- Choose the database management system. Supported values= are 'mysql' for MySQL, 'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' fo= r PostgreSQL. Only if reporting.databaseConfigurationMethod=3DwithoutHib= ernateFile --> <entry key=3D"reporting.databaseDbms" value=3D"mysql"/> =20 <!-- Path to a hibernate configuration file if reporting.dat= abaseConfigurationMethod=3DwithHibernateFile --> <entry key=3D"reporting.hibernateConfFile" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"reportingDbconnectio= n"> <userInput> <!-- Reporting Database Configuration if reporting.database= ConfigurationMethod=3DwithoutHibernateFile --> =20 <!-- Enter the name or ip address of the database host=20 This entry can also be used to configure the URL(s) for Or= acle RAC databases. For example: <entry key=3D"reporting.databaseHost" value=3D"(DESCRIP= TION=3D(ADDRESS_LIST=3D(LOAD_BALANCE=3DOFF)(FAILOVER=3DON) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db1.myco.com)(PO= RT=3D1604)) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db2.myco.com)(PO= RT=3D1604))) (CONNECT_DATA=3D(SERVICE_NAME=3Dmydb1.myco.com)(SERVER= =3DDEDICATED)))"/> The "reporting.databaseSchema" and "reporting.databasePort= " entries should then be left empty. --> <entry key=3D"reporting.databaseHost" value=3D"mysql-5-7"/&g= t; =20 <!-- Enter the port number for the database instance. Defaul= t ports are for MySQL 3306,=20 Oracle 1521, MS SQL Server 1433, postgreSQL 5432. --> <entry key=3D"reporting.databasePort" value=3D"3306"/> =20 <!-- Enter the schema --> <entry key=3D"reporting.databaseSchema" value=3D"jobschedule= r113"/> =20 <!-- Enter the user name for database access --> <entry key=3D"reporting.databaseUser" value=3D"jobscheduler"= /> =20 <!-- Enter the password for database access --> <entry key=3D"reporting.databasePassword" value=3D"jobschedu= ler"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"reportingJdbc"> <userInput> <!-- Reporting Database Configuration=20 NOT SUPPORTED FOR SYBASE AND DB2 --> =20 <!-- You can specify an external JDBC connector then set rep= orting.internalConnector =3D no For license reasons MySQL, MS SQL Server and Oracle ojdbc7= JDBC=20 drivers are not provided.=20 Alternatively you can use the mariadb JDBC Driver for MySQ= L and=20 the jTDS JDBC Driver for MS SQL Server and Sybase which is= provided.=20 An Oracle ojdbc6 JDBC driver is also provided. --> =20 <!-- You can choose between 'yes' or 'no' for using the inte= rnal JDBC connector or not --> <entry key=3D"reporting.internalConnector" value=3D"yes"/>= ; =20 <!-- Select the path to JDBC Driver --> <entry key=3D"reporting.connector" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"database"> <userInput> <!-- JobScheduler Database Configuration --> =20 <!-- Set 'yes' if the Reporting and the JobScheduler databas= e are the same. If 'yes' then further JobScheduler database variables are = ignored. --> <entry key=3D"sameDbConnection" value=3D"yes"/> =20 <!-- Database connection settings can be specified with foll= owing entries such as databaseHost, databasePort, ... or by a hibernate configur= ation file=20 Posible values are 'withoutHibernateFile' (default) and 'w= ithHibernateFile'. --> <entry key=3D"databaseConfigurationMethod" value=3D"withoutH= ibernateFile"/> =20 <!-- Choose the database management system. Supported values= are 'mysql' for MySQL, 'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' fo= r PostgreSQL, 'db2' for DB2 and 'sybase' for Sybase.=20 Only if databaseConfigurationMethod=3DwithoutHibernateFile= --> <entry key=3D"databaseDbms" value=3D"mysql"/> =20 <!-- Path to a hibernate configuration file if databaseConfi= gurationMethod=3DwithHibernateFile --> <entry key=3D"hibernateConfFile" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"dbconnection"> <userInput> <!-- JobScheduler Database Configuration if databaseConfigur= ationMethod=3DwithoutHibernateFile --> =20 <!-- Enter the name or ip address of the database host=20 This entry can also be used to configure the URL(s) for Or= acle RAC databases. For example: <entry key=3D"databaseHost" value=3D"(DESCRIPTION=3D(AD= DRESS_LIST=3D(LOAD_BALANCE=3DOFF)(FAILOVER=3DON) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db1.myco.com)(PO= RT=3D1604)) (ADDRESS=3D(PROTOCOL=3DTCP)(HOST=3Dtst-db2.myco.com)(PO= RT=3D1604))) (CONNECT_DATA=3D(SERVICE_NAME=3Dmydb1.myco.com)(SERVER= =3DDEDICATED)))"/> The "databaseSchema" and "databasePort" entries should the= n be left empty. --> <entry key=3D"databaseHost" value=3D"mysql-5-7"/> =20 <!-- Enter the port number for the database instance. Defaul= t ports are for MySQL 3306,=20 Oracle 1521, MS SQL Server 1433, postgreSQL 5432, DB2 5000= 0, Sybase 5000. --> <entry key=3D"databasePort" value=3D"3306"/> =20 <!-- Enter the schema --> <entry key=3D"databaseSchema" value=3D"jobscheduler113"/> =20 <!-- Enter the user name for database access --> <entry key=3D"databaseUser" value=3D"jobscheduler"/> =20 <!-- Enter the password for database access --> <entry key=3D"databasePassword" value=3D"jobscheduler"/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"jdbc"> <userInput> <!-- JobScheduler Database Configuration --> =20 <!-- You can specify an external JDBC connector then set int= ernalConnector =3D no For license reasons MySQL, Sybase, MS SQL Server and Oracl= e ojdbc7 JDBC=20 drivers are not provided.=20 Alternatively you can use the mariadb JDBC Driver for MySQ= L and=20 the jTDS JDBC Driver for MS SQL Server and Sybase which is= provided.=20 An Oracle ojdbc6 JDBC driver is also provided. An internal JDBC connector for DB2 is not available --> =20 <!-- You can choose between 'yes' or 'no' for using the inte= rnal JDBC connector or not --> <entry key=3D"internalConnector" value=3D"yes"/> =20 <!-- Select the path to JDBC Driver --> <entry key=3D"connector" value=3D""/> =20 <!-- Only for DB2: Select the path to DB2 license file for J= DBC Driver --> <entry key=3D"connectorLicense" value=3D""/> =20 </userInput> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.UserInputPanel id=3D"end"> <userInput/> </com.izforge.izpack.panels.UserInputPanel> =20 <com.izforge.izpack.panels.InstallPanel id=3D"install"/> =20 <com.izforge.izpack.panels.ProcessPanel id=3D"process"/> =20 <com.izforge.izpack.panels.FinishPanel id=3D"finish"/> </AutomatedInstallation>
Download: start_joc.sh
#!/bin/s= h /opt/sos-berlin.com/joc/jetty/bin/jetty.sh start && tail -f /dev/nu= ll
jetty.sh
is used. The There are a number of ways how to write a build command, find the follow= ing example:
A typical build command could look like this:
#!/bin/s= h IMAGE_NAME=3D"joc-1-13" docker build --no-cache --rm --tag=3D$IMAGE_NAME --file=3D./build/Dockerfil= e --network=3Djs --build-arg=3D"USER_ID=3D$UID" ./build
--build-arg
that injects the USE=
R_ID
environment variable into the image with the numeric ID of the =
account running the build command. This simplifies later access to the opti=
onally exposed volume specified by the Dockerfile as the same numeric user =
ID and group ID inside and outside of the container are used.There are a number of ways how to write a run command, find the followin= g example:
A typical run command could look like this:
#!/bin/s= h IMAGE_NAME=3D"joc-1-13" RUN_USER_ID=3D"$(id -u $USER):$(id -g $USER)" mkdir -p /some/path/logs docker run -dit --rm --user=3D$RUN_USER_ID --hostname=3D$IMAGE_NAME --netwo= rk=3Djs --publish=3D4446:4446 --volume=3D/some/path/logs:/var/log/sos-berli= n.com/joc:Z --name=3D$IMAGE_NAME $IMAGE_NAME
RUN_USER_ID
variable is populated with the numeric ID =
of the account and the group that executes the run command. This value is a=
ssigned the --user
option to inject the account information in=
to the container (replacing the account specified with the USE jobsch=
eduler
instruction in the Dockerfile).logs
directory to be created that is refere=
nced with the --volume
option to expose the log directory of t=
he JOC Cockpit for reading. Avoid to modify log files in this director=
y and to add new files.