Introduction
The JS7 - Controller Installation for Docker Containers article explains start-up of a JOC Cockpit container using the Docker® Run
command.
The following examples apply for users who wish to start containers using the docker-compose
utility. Consider that examples have to be adjusted to individual environments.
Examples are contributed by the Japanese JS7 Community. Find the complete instructions from the Start with JS7 JobScheduler docker-compose (MySQL version) article.
Preparation
Docker Compose Configuration: docker-compose.yaml
Download: docker-compose.yml
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 how to mount or bind volumes into a container.
- One strategy is to mount a Docker® volume that is managed by Docker® typically in
/var/lib/docker/volumes
. - Another strategy is to map Docker® volumes to the local file system. This requires to let Docker® Compose know that the volume is locally managed. This is what the above example is focused on.
- One strategy is to mount a Docker® volume that is managed by Docker® typically in
Environment Variables used with the Examples
echo -e "JS7USERID=$(id -u)\nJS7GROUPID=$(id -g)\nJS7VERSION=2-3-2" > .env # check environment variables cat .env JS7USERID=1000 JS7GROUPID=1000 JS7VERSION=2-3-2
Directories used with the Examples
mkdir js7-controller-primary
Directory Hierarchy
. ├── .env ├── docker-compose.yml └── js7-controller-primary
Container Start-up
Start Container
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.