Skip to end of metadata
Go to start of metadata

Introduction

The JS7 - Controller Installation for Docker Containers article explains start-up of a Controller container using the Docker® Run command.

The following examples apply for users who wish to start containers using the docker-compose utility. Note that examples have to be adjusted to suit individual environments.

Examples have been contributed by the Japanese JS7 Community. The complete instructions can be found in the Start with JS7 JobScheduler docker-compose (MySQL version) article.

Preparation

Docker Compose Configuration: docker-compose.yml

Download: docker-compose.yml

Example for use of Docker Compose
version: '3'

services:

  js7-controller-primary:
    image: sosberlin/js7:controller-${JS7VERSION}
    hostname: js7-controller-primary
    volumes:
      - js7-controller-primary:/var/sos-berlin.com/js7/controller/var
    networks:
      - js7
    environment:
      RUN_JS_JAVA_OPTIONS: -Xmx256m
      RUN_JS_USER_ID: "${JS7USERID}:${JS7GROUPID}"
    restart: "no"

networks:

  js7:
    external: true

volumes:

  js7-controller-primary:
    driver: local
    driver_opts:
      type: none
      device: ${PWD}/js7-controller-primary
      o: bind
      o: bind


Explanation:

  • Use of volumes: There are a number of ways of mounting or binding volumes into a container.
    • One strategy is to mount a Docker® volume which is managed by Docker®, typically in /var/lib/docker/volumes.
    • Another strategy is to map Docker® volumes to the local file system. This requires letting Docker® Compose know that the volume is locally managed and is the focus of the above example.

Environment Variables used with the Examples

Environment Variables used with the Examples
echo -e "JS7USERID=$(id -u)\nJS7GROUPID=$(id -g)\nJS7VERSION=2-5-0" > .env

# check environment variables
cat .env
JS7USERID=1000
JS7GROUPID=1000
JS7VERSION=2-5-0

Directories used with the Examples

Directories used with the Examples
mkdir js7-controller-primary

Directory Hierarchy

Directories used with the Examples
. 
├── .env 
├── docker-compose.yml
└── js7-controller-primary

Container Start-up

Start Container

Example how to start up Containers
docker-compose up -d

# check containers
$ docker-compose ps
NAME                            COMMAND                  SERVICE                  STATUS              PORTS
js74-js7-controller-primary-1   "sh /usr/local/bin/e…"   js7-controller-primary   running             

Initial Operation

See JS7 - Controller Installation for Docker Containers, section: Initial Operation.



  • No labels