Versions Compared

Key

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

...

  • Line 1: The base image is OpenJDK Java 1.8 (Debian 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. Consider 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 36 32 - 3733: 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 51: if a config folder is available in the build directory then its contents 46: the joc_install.xml response file is copied to the respective config folder in the container. This can be useful to create an image with individual settings in configuration files, see image. This file includes settings for headless installation of JOC Cockpit, see JS7 - JOC Cockpit Configuration Items.Installation On Premises. In fact when building the image a JOC Cockpit installation is performed.
  • Line 47: the hibernate.cfg.xml configuration file is copied that holds the database connection settings for JOC Cockpit. The database has to be available during build of the Docker image. Users can later on choose a different database connection by modifying/overwriting this file at run-time.
  • Line 48: 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 Line 54: The start-joc.sh script is copied from the build directory to the container. Users can apply their own version of the start script. The start script used by SOS looks like this:

    Code Block
    languagebash
    titleJOC Cockpit Start Script
    linenumberstrue
    collapsetrue
    #!/bin/sh
    
    js_java_options=""
    
    for option in "$@"
    do
      case "$option" in
             --java-options=*) js_java_options=`echo "$option" | sed 's/--java-options=//'`
                               ;;
             *)                echo "unknown argument: $option"
                               exit 1
                               ;;
      esac
    done
    
    
    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 57 51 - 5852: 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.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 53: The JOC Cockpit setup is performed.
  • Line 59: The Jetty servlet container is added the HTTPS module for use with JOC Cockpit.
  • Line 62 - 63: The default keystore and truststore is copied that hold the private key and certificate required for server authentication with HTTPS.
  • Line 66 - 69: The keystore and truststore locations are added to the Jetty start.ini file and joc.properties file respectively. 
    • start.ini is used for access e.g. by client browsers.
    • joc.properties is used for connections to the Controller should such connections require HTTPS mutual authentication.
  • Line 72: if a config folder is available in the build directory then its contents is copied to the respective config folder in the image. This can be useful to create an image with individual settings in configuration files, see JS7 - JOC Cockpit Configuration Items.
  • Line 80Line 67: The HTTP port and optionally the HTTPS port are exposed to the Docker host. Both ports can be forwarded by environment variables when running the container, overwriting the build-time values. This is relevant only if users want to use ports inside the container that are different from the default values. In most situations the default ports should be fine and are mapped to outside ports on the Docker host when starting the container.
  • Line 6985: The start script is executed and is dynamically parameterized from environment variables that are forwarded when starting the container.

...