Page History
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
docker image pull sosberlin/js7:joc-2-3-12 |
Running the JOC Cockpit Container
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/sh docker run -dit --rm \ --hostname=js7-joc-primary \ --network=js7 \ --publish=17446:4446 \ --env="RUN_JS_JAVA_OPTIONS=-Xmx256m" \ --env="RUN_JS_USER_ID=$(id -u $USER):$(id -g $USER)" \ --mount="type=volume,src=js7-joc-primary-config,dst=/var/sos-berlin.com/js7/joc/resources/joc" \ --mount="type=volume,src=js7-joc-primary-logs,dst=/var/log/sos-berlin.com/js7/joc" \ --name js7-joc-primary \ sosberlin/js7:joc-2-3-12 |
Explanation:
--network
The above example makes use of a Docker network - created, for example, using thedocker network create js7
command - to allow network sharing between containers. Note that any inside ports used by Docker containers are visible within a Docker network. Therefore a JOC Cockpit instance running for the inside port4446
can be accessed with the container's hostname and the same port within the Docker network.--publish
The JOC Cockpit has been configured to listen to the HTTP port4446
. An outside port of the Docker host can be mapped to the JOC Cockpit inside HTTP port. This is not required for use with a Docker network, see--network
. However, it will allow direct access to the JOC Cockpit from the Docker host via its outside port .--env=RUN_JS_JAVA_OPTIONS
This allows any Java options to be injected into the JOC Cockpit container. Preferably this is used to specify memory requirements of the JOC Cockpit, for example, with-Xmx256m
.--env=RUN_JS_USER_ID
Inside the container the JOC Cockpit is operated by thejobscheduler
user account. In order to access, for example, log files created by the JOC Cockpit, which are mounted to the Docker host, it is recommended that you map the account that starts the container to thejobscheduler
account inside the container. TheRUN_JS_USER_ID
environment variable accepts the user ID and group ID of the account that will be mapped. The example above makes use of the current user.--mount
The following volume mounts are suggested:config
: The optional configuration folder allows specification of individual settings for JOC Cockpit operation - see the sections below and the JS7 - JOC Cockpit Configuration Items article. Without this folder the default settings are used.logs
: In order to make JOC Cockpit log files persistent they have to be written to a volume that is mounted for the container. Feel free to adjust the volume name from thesrc
attribute. However, the value of thedst
attribute should not be changed as it reflects the directory hierarchy inside the container.Docker offers a number of ways of mounting or binding volumes to containers including, for example, creation of local directories and binding them to volumes like this:
Code Block language bash title Example how to create Docker volumes linenumbers true # example to map volumes to directories on the Docker host prior to running the JOC Cockpit container mkdir -p /home/sos/js7/js7-joc-primary/config /home/sos/js7/js7-joc-primary/logs docker volume create --driver local --opt o=bind --opt type=none --opt device="/home/sos/js7/js7-joc-primary/config" js7-joc-primary-config docker volume create --driver local --opt o=bind --opt type=none --opt device="/home/sos/js7/js7-joc-primary/logs" js7-joc-primary-logs
There are alternative ways of achieving this. As a result you should have a access to the directories
/var/sos-berlin.com/js7/joc/resources/joc
and/var/log/sos-berlin.com/js7/joc
inside the container and data in both locations should be persistent. If volumes are not created before running the container then they will be mounted automatically. However, you should have access to data in the volumes, e.g. by access to/var/lib/docker/volumes/js7-joc-primary-config
etc.
...
- JDBC Drivers for use with H2®, MariaDB®, MySQL®, Oracle®, PostgreSQL® are included with JS7.
- For details about JDBC Driver versions see the JS7 - Database article.
- Should you have a good reason to use a different version of a JDBC Driver then you can apply the JDBC Driver version of your choice.
- For details about JDBC Driver versions see the JS7 - Database article.
- For use with H2®
- The version of H2® successfully tested by SOS is
h2-1.4.200.jar
. At the time of writing later versions do not provide sufficient compatibility with MySQL to be applicable for JS7.
- The version of H2® successfully tested by SOS is
- For use with Microsoft SQL Server®
- the JDBC Driver has to be downloaded by the user as it cannot be bundled with open source software due to license conflicts.
- You can download JDBC Drivers from vendor's sites and store the resulting *.jar file(s) in the following location:
- Location in the container:
/var/sos-berlin.com/js7/joc/resources/joc/lib
- Consider accessing this directory from the volume that is mounted when running the container, for example, from a local folder
/home/sos/js7/js7-joc-primary/config/lib
. - Refer to the JS7 - Database article for details about the procedure.
- Location in the container:
...