Page History
...
- Line 1: The base image is OpenJDK Java 1.8 (Alpine based). You can run JOC Cockpit with newer Java releases, however, stick to Oracle, OpenJDK or AdoptOpenJDK as the source for your Java base image. Alternatively you can use your own base image and install Java 1.8 on top of this. Note that availability of JDBC Drivers can limit the Java version to be used.
- Line 8 - 9: The release identification is injected by build arguments. This information is used to determine the tarball to be downloaded.
- Line 12 - 15: Defaults for the user id running the JOC Cockpit inside the container as well as HTTP and HTTPS ports are provided. These values can be overwritten by providing the respective build arguments.
- Line 20 - 22: Environment variables are provided at run-time, not at build-time. They can be used to specify ports and Java options when running the container.
- Line 27 - 30: The image OS is updated and additional packages are installed (ps, netstat, bash).
- Line 33 - 34: You can either download the JOC Cockpit tarball directly from the SOS web site or you store the tarball with the build directory and copy from this location.
Line 3741: the
joc_install.xml
response file is copied to the image. This file includes settings for headless installation of JOC Cockpit, see JS7 - JOC Cockpit Installation On Premises. In fact when building the image a JOC Cockpit installation is performed.Code Block language xml title JOC Cockpit Installer Response File linenumbers true collapse true <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- XML configuration file for JOC If you call the installer with this XML file then you accept at the same time the terms of the licence agreement under GNU GPL 2.0 License (see http://www.gnu.org/licenses/gpl-2.0.html) --> <AutomatedInstallation langpack="eng"> <com.izforge.izpack.panels.UserInputPanel id="home"> <userInput/> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.HTMLLicencePanel id="gpl_licence"/> <com.izforge.izpack.panels.TargetPanel id="target"> <!-- SELECT THE INSTALLATION PATH It must be absolute! For example: /opt/sos-berlin.com/joc on Linux C:\Program Files\sos-berlin.com\joc on Windows --> <installpath>/opt/sos-berlin.com/js7/joc</installpath> </com.izforge.izpack.panels.TargetPanel> <com.izforge.izpack.panels.UserInputPanel id="jetty"> <userInput> <!-- JOC requires a servlet container such as Jetty. If a servlet container already installed then you can use it. Otherwise a Jetty will be installed in addition if withJettyInstall=yes. You need root permissions to install JOC with Jetty. --> <entry key="withJettyInstall" value="yes"/> <entry key="jettyPort" value="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 unique per server. This entry is deactivated by a comment because it MUST NOT BE CHANGED DURING OVER-INSTALLATION! --> <!-- <entry key="jettyServiceName" value="joc"/> --> <!-- Only necessary for Windows --> <entry key="jettyStopPort" value="44446"/> <!-- Only necessary for Unix (root permissions required) --> <entry key="withJocInstallAsDaemon" value="yes"/> <!-- To enter a JOC User (default=current User). For Unix only (root permissions required)!!! --> <entry key="runningUser" value="jobscheduler"/> <!-- Path to Jetty base directory For example: /home/[user]/sos-berlin.com/joc on Linux C:\ProgramData\sos-berlin.com\joc on Windows --> <entry key="jettyBaseDir" value="/var/sos-berlin.com/js7/joc"/> <!-- Choose (yes or no) wether the JOC's Jetty should be (re)started at the end of the installation --> <entry key="launchJetty" value="no"/> <!-- Java options for Jetty. --> <!-- Initial memory pool (-Xms) in MB --> <entry key="jettyOptionXms" value="128"/> <!-- Maximum memory pool (-Xmx) in MB --> <entry key="jettyOptionXmx" value="512"/> <!-- Thread stack size (-Xss) in KB --> <entry key="jettyOptionXss" value="4000"/> <!-- Further Java options --> <entry key="jettyOptions" value=""/> </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id="joc"> <userInput> <!-- JOC can be installed in a cluster. Please type a unique title to identify the cluster node, e.g. hostname. Max. length is 30 characters --> <entry key="jocTitle" value="PRIMARY JOC COCKPIT"/> <!-- Choose yes if JOC is a standby node in a cluster --> <entry key="isStandby" value="no"/> <!-- Security Level for the signing mechanism: possibly values are 'LOW', 'MEDIUM' and 'HIGH' HIGH: public PGP keys are stored for verification only all signing will be done externally outside of JOC Cockpit MEDIUM: a private PGP key will be stored for signing signing will be done automatically with the provided key LOW: no keys will be stored signing will be done internally with default keys --> <entry key="securityLevel" value="LOW"/> </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id="database"> <userInput> <!-- Reporting Database Configuration --> <!-- Database connection settings can be specified with following entries such as databaseHost, databasePort, ... or by a hibernate configuration file Posible values are 'withoutHibernateFile' (default) and 'withHibernateFile'. --> <entry key="databaseConfigurationMethod" value="withoutHibernateFile"/> <!-- Choose the database management system. Supported values are 'mysql' for MySQL, 'oracle' for Oracle, 'mssql' for MS SQL Server, 'pgsql' for PostgreSQL. Only if databaseConfigurationMethod=withoutHibernateFile --> <entry key="databaseDbms" value="mysql"/> <!-- Path to a hibernate configuration file if databaseConfigurationMethod=withHibernateFile --> <entry key="hibernateConfFile" value=""/> <!-- You can choose between 'on' or 'off' to create the database tables. If you have modified the initial data of an already existing installation, then the modifications will be undone. Data added remains unchanged. This entry should be only 'off', when you sure, that all tables are already created. --> <entry key="databaseCreateTables" value="off"/> </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id="dbconnection"> <userInput> <!-- Database Configuration if databaseConfigurationMethod=withoutHibernateFile --> <!-- Enter the name or ip address of the database host This entry can also be used to configure the URL(s) for Oracle RAC databases. For example: <entry key="databaseHost" value="(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=OFF)(FAILOVER=ON) (ADDRESS=(PROTOCOL=TCP)(HOST=tst-db1.myco.com)(PORT=1604)) (ADDRESS=(PROTOCOL=TCP)(HOST=tst-db2.myco.com)(PORT=1604))) (CONNECT_DATA=(SERVICE_NAME=mydb1.myco.com)(SERVER=DEDICATED)))"/> The "databaseSchema" and "databasePort" entries should then be left empty. --> <entry key="databaseHost" value=""/> <!-- Enter the port number for the database instance. Default ports are for MySQL 3306, Oracle 1521, MS SQL Server 1433, postgreSQL 5432. --> <entry key="databasePort" value=""/> <!-- Enter the schema --> <entry key="databaseSchema" value=""/> <!-- Enter the user name for database access --> <entry key="databaseUser" value=""/> <!-- Enter the password for database access --> <entry key="databasePassword" value=""/> </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id="jdbc"> <userInput> <!-- Database Configuration --> <!-- You can specify an external JDBC connector then set internalConnector = no For license reasons MySQL, MS SQL Server and Oracle ojdbc7 JDBC drivers are not provided. Alternatively you can use the mariadb JDBC Driver for MySQL and the jTDS JDBC Driver for MS SQL Server which is provided. An Oracle ojdbc6 JDBC driver is also provided. --> <!-- You can choose between 'yes' or 'no' for using the internal JDBC connector or not --> <entry key="internalConnector" value="yes"/> <!-- Select the path to JDBC Driver --> <entry key="connector" value=""/> </userInput> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.UserInputPanel id="end"> <userInput/> </com.izforge.izpack.panels.UserInputPanel> <com.izforge.izpack.panels.InstallPanel id="install"/> <com.izforge.izpack.panels.ProcessPanel id="process"/> <com.izforge.izpack.panels.FinishPanel id="finish"/> </AutomatedInstallation>
Line 3842: The
start-joc.sh
script is copied from the build directory to the image. Users can apply their own version of the start script. The start script used by SOS looks like this:Code Block language bash title JOC Cockpit Start Script linenumbers true collapse true #!/bin/sh js_http_port="" js_https_port="" js_java_options="" for option in "$@" do case "$option" in --http-port=*) js_http_port=`echo "$option" | sed 's/--http-port=//'` ;; --https-port=*) js_https_port=`echo "$option" | sed 's/--https-port=//'` ;; --java-options=*) js_java_options=`echo "$option" | sed 's/--java-options=//'` ;; *) echo "unknown argument: $option" exit 1 ;; esac done js_args="" if [ ! "$js_http_port" = "" ] then # enable http access sed -i "s/.*--module=http$/--module=http/g" /var/sos-berlin.com/js7/joc/start.ini # set port for http access sed -i "s/.*jetty.http.port\s*=.*/jetty.http.port=$js_http_port/g" /var/sos-berlin.com/js7/joc/start.ini else # disable http access sed -i "s/\s*--module=http$/# --module=http/g" /var/sos-berlin.com/js7/joc/start.ini fi if [ ! "$js_https_port" = "" ] then # enable https access sed -i "s/.*--module=https$/--module=https/g" /var/sos-berlin.com/js7/joc/start.ini # set port for https access sed -i "s/\s*jetty.ssl.port\s*=.*/jetty.ssl.port=$js_https_port/g" /var/sos-berlin.com/js7/joc/start.ini else # disable https access sed -i "s/\s*--module=https$/# --module=https/g" /var/sos-berlin.com/js7/joc/start.ini fi if [ ! -z "$js_java_options" ] then export JAVA_OPTIONS="${JAVA_OPTIONS} $js_java_options" fi echo "starting JOC Cockpit: /opt/sos-berlin.com/js7/joc/jetty/bin/jetty.sh start" /opt/sos-berlin.com/js7/joc/jetty/bin/jetty.sh start && tail -f /dev/null
- Line 41 - 42: The default keystore and truststore files are copied that would hold the private key and certificate required for server authentication with HTTPS. By default empty keystore and truststore files are used that you would later on add your private keys and certificates to.Line 6459: Java releases < Java 12 make use of
/dev/random
for random number generation. This is a bottleneck as random number generation with this file is blocking. Instead/dev/urandom
should be used that implements non-blocking behavior. The change of the random file is applied to the Java security file. - Line 6661: The user account
jobscheduler
is created and is assigned the user id and group id handed over by the respective build arguments. This translates to the fact that the account running the JOC Cockpit inside the container and the account that starts the container are assigned the same user id and group id. This allows the account running the container to access any files created by the JOC Cockpit in mounted volumes with identical permissions. - Line 6762: The JOC Cockpit setup is performed.
- Line 68 63 - 7065: The keystore and truststore locations are added to the Jetty
start.ini
file andjoc.properties
file respectively.start.ini.add
is used for access e.g. by client browsers:Code Block language bash title Jetty HTTPS Configuration File start.ini.add linenumbers true collapse true ## Keystore file path (relative to $jetty.base) jetty.sslContext.keyStorePath=resources/joc/https-keystore.p12 ## Truststore file path (relative to $jetty.base) jetty.sslContext. trustStorePath=resources/joc/https-truststore.p12 ## Keystore password jetty.sslContext.keyStorePassword=jobscheduler ## KeyManager password (same as keystore password for pkcs12 keystore type) jetty.sslContext.keyManagerPassword=jobscheduler ## Truststore password jetty.sslContext.trustStorePassword=jobscheduler ## Connector port to listen on jetty.ssl.port=4443
joc.properties.add
is used for connections to the Controller should such connections require HTTPS mutual authentication:Code Block language bash title JOC Cockpit configuration File joc.properties.add linenumbers true collapse true ################################################################################ ### Location, type and password of the Java truststore which contains the ### certificates of eachJobScheduler Controller for HTTPS connections. Path can be ### absolute or relative to this file. keystore_path = ../../resources/joc/https-keystore.p12 keystore_type = PKCS12 keystore_password = jobscheduler key_password = jobscheduler truststore_path = ../../resources/joc/https-truststore.p12 truststore_type = PKCS12 truststore_password = jobscheduler
- Line 7166: The Jetty servlet container is added the HTTPS module for use with JOC Cockpit.
- Line 8273: If a
config
folder is available in the build directory then its contents are copied to the respectiveconfig
folder in the image. This can be useful to create an image with individual settings in configuration files, see JS7 - JOC Cockpit Configuration Items.- x
- The default keystore and truststore files are copied that would hold the private key and certificate required for server authentication with HTTPS. By default empty keystore and truststore files are used that you would later on add your private keys and certificates to.
- Line 80Line 89: The start script is executed and is dynamically parameterized from environment variables that are forwarded when starting the container.
...