Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titlePulling the JOC Cockpit Image
linenumberstrue
docker image pull sosberlin/js7:joc-2-1-0-1

Running the JOC Cockpit Container

...

Code Block
languagebash
titleRunning the JOC Cockpit Container for HTTP Connections
linenumberstrue
#!/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-1-0-1

Explanation:

  • --network The above example makes use of a Docker network - created, for example, using the docker 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 port 4446 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 port 4446. 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 JOC Cockpit, for example,  with -Xmx256m.
  • --env=RUN_JS_USER_ID Inside the container the JOC Cockpit is operated by the jobscheduler 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 is starting the container to the jobscheduler account inside the container. The RUN_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 chapters 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 the src attribute. However, the value of the dst 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
      languagebash
      titleExample how to create Docker volumes
      linenumberstrue
      # 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 how to achieve 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.

...

You have a choice of registering a Standalone Controller or registering a Controller Cluster for high availability (requires JS7 - LicensingLicense.

Register Standalone Controller

...

Note that the high availability clustering feature is subject to JS7 - LicensingLicense. Without a license, fail-over/switch-over will not take place between Controller cluster members.

...