- JobScheduler Master is operated with a Docker container.
- The JobScheduler Master requires a database to be available from any physical or virtual host or from a Docker container.
- Consider to prepare the files indicated with chapter Build.
The following files are required for the build context:
- Installer Response file
jobscheduler_install.xmlwith individual installation settings. A template of this file is available when extracting the installer tarball.
- Start Script
- JobScheduler Master installer tarball as available from SOS for download.
- Line 1: We start from an Alpine image that includes JDK 8. Newer Java version can be used, see Which Java versions is JobScheduler available for?
- Line 5: Consider that $UID provides the numeric ID of the account that the JobScheduler Master installation inside the Docker container is performed for. This numeric ID typically starts above 1000 and should correspond to the account that is used on the Docker host, i.e. the account on the Docker Host and the account inside the container should use the same numeric ID. This mechanism simplifies exposure of the Docker container's file system.
- Line 8-9: Adjust the JobScheduler release number as required.
- Line 12-16: The installer tarball is copied and extracted to the container.
- Line 22-23: The installer response file is copied to the container, for details of this file see next chapter. Then the installer is executed for the current user.
- Line 26-28: An account and group "jobscheduler" is created that is handed over ownership of installed files.
- Line 31-32: The start script is copied to the container, see below chapter Start Script.
- Line 35: A volume is indicated for later mapping to a mount point at run-time.
- Line 38: Port 40444 is exposed for later mapping. This port is used for the connection between JOC Cockpit and JobScheduler Master.
- Line 41: The account "jobscheduler" that is the owner of the installation is exposed for later mapping. This account should be mapped at run-time to the account in the Docker Host that will mount the exposed volume.
- Line 43: The start script is executed to launch the JobScheduler Master daemon.
Installer Response File
- The above installer response file works for releases 1.13. Other releases ship with different versions of this file. You should pick-up a template of this file that matches your JobScheduler release by extracting the installer tarball.
- Generally all defaults of the response file can be maintained.
- This includes use of port 40444 for the connection of JOC Cockpit to the Master. At run-time this port can be mapped, see Dockerfile.
- Line 182-233: The database connection makes use of a hostname "mysql-5-7" that is assumed to be the hostname of a Docker container in the same Docker network running the MySQL database.
- Modify the database connection settings as required for use with your DBMS and access credentials.
- Line 3: The standard start script
jobscheduler.shis used. The
tailcommand prevents the start script from terminating in order to keep the container alive. The sub-directory
testsuiterepresents the JobScheduler ID that is specified with the above installer response file.
- Line 3: The standard start script
There are a number of ways how to write a build command, find the following example:
A typical build command could look like this:
- Using a common network for JobScheduler components allows direct access to resources such as ports within the network. The network is required at build time to allow the installer to create and to populate the JobScheduler database.
- Consider use of the
--build-argthat injects the
USER_IDenvironment variable into the image with the numeric ID of the account running the build command. This simplifies later access to the volume exposed 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 following example:
- Before starting the container consider to create a Docker volume to persistently store configuration files in the
livefolder of the JobScheduler Master installation:
- Create the Docker volume with an arbitrary name, e.g. the image name.
- Create a symlink
livethat points to the Docker volume
- Adjust permissions to allow the current user to read/execute from docker volumes. Make the current user the owner of the newly created volume.
- This configuration will expose the Master's live directory to the Docker volume and allows the current user to add/update/delete configuration files to the
A typical run command could look like this:
- Using a common network for JobScheduler components allows direct access to resources such as ports within the network.
RUN_USER_IDvariable is populated with the numeric ID of the account and the group that executes the run command. This value is assigned the
--useroption to inject the account information into the container (replacing the account specified with the
USE jobschedulerinstruction in the Dockerfile).
- Port 40444 for access to JobScheduler Master by JOC Cockpit can optionally be mapped to some outside port. This is not required if a network is used.
- Specify a
logsdirectory to be created that is referenced with the
--volumeoption to expose the log directory of the JobScheduler Master for reading. Consider that the
testsuitesub-directory is created from the value of the JobScheduler ID that is specified with the installer response file. Avoid to modify log files in this directory and to add new files.
--mountoption is used in order to map a previously created Docker volume (assumed to be the value of the
src=option) e.g. to the JobScheduler Master's
livefolder. This allows to read and to write job related files to this directory that will automatically be picked up by JobScheduler Master.