Docker image for running the correctomatic processes: starter, completer and notifier. It's the same image for the three processes. The source code for the correctomatic processes is in the correction-runner repository.
The image is available in Docker Hub.
TO-DO: configure access to a private registry
There are two ways of configuring the image: with environment variables or with an .env file. In both cases, the variables are the same as defined in the correction-runner's .env-example file.
You can use a .env file to configure the container. Mount the file to the container in the /app directory:
docker run --rm \
-v /path/to/.env:/app/.env \
correctomatic/runnerThe documentation for shuch .env file is in the correction-runner repository, but are the same as the environment variables described below.
The main variables you can pass are:
PROCESS: One of the three processes:starter,completerornotifier. This environment variable is mandatory.REDIS_HOST: Host of the redis server, from the container's point of view.REDIS_PORT: Port of the redis serverREDIS_PASSWORD: Password for the redis serverDOCKER_OPTIONS: JSON Dockerode options for connecting to the docker server. If empty, will connecto to the local docker socket. See below for an example.DOCKER_OPTIONS_FILE: Path to a file with the docker options. IfDOCKER_OPTIONSis set, it will be ignored.DOCKER_TIMEOUT: Timeout for the docker commandsDOCKER_PULL: If set totrue, the container will pull the images before starting the tasks.DOCKER_PULL_TIMEOUT: Timeout for the docker pull command.DOCKER_REPOSITORY_CREDENTIALS: JSON object with the credentials for the docker repository. The key is the repository URL, and the value is an object with theusernameandpasswordkeys.DOCKER_REPOSITORY_CREDENTIALS_FILE: Path to a file with the docker repository credentials. IfDOCKER_REPOSITORY_CREDENTIALSis set, it will be merged with the contents of this file.CONCURRENT_NOTIFIERS: Number of concurrent jobs sending notifications of completed tasks.
There are also variables for debugging:
LOG_LEVEL: Log level for the application.LOG_FILE: File where the logs will be written. The path is from the container's point of view. If empty, it will log to stdout.DONT_START_CONTAINER: If set to S, the containers will not start. This is for debugging the completer.
This is an example of how to run the container to connect to a remote docker server. You will need to mount the certificates in the container, and set the DOCKER_OPTIONS environment variable:
docker run --rm \
-e PROCESS=starter \
-e REDIS_HOST=redis \
-e REDIS_PORT=6379 \
-e REDIS_PASSWORD=value \
-e DOCKER_OPTIONS='{
"host": "your.docker.host.here",
"protocol": "https",
"port": 2376,
"ca": "/certs/ca.pem",
"cert": "/certs/cert.pem",
"key": "/certs/key.pem"
}' \
-e DOCKER_TIMEOUT=5000 \
-e DOCKER_PULL=true \
-e DOCKER_PULL_TIMEOUT=10000 \
-e DOCKER_REPOSITORY_CREDENTIALS='{
"your.docker.registry.here": {
"username": "your-username",
"password": "your-password"
}
}' \
-e NODE_ENV=value \
-e LOG_LEVEL=info \
-e LOG_FILE=/var/log/correctomatic/correctomatic.log \
-e CONCURRENT_NOTIFIERS=10 \
-v /your/local/certs/dir:/certs \
correctomatic/runnerAlternatively, you can use files with the docker options and the repository credentials.
Here is an example of how to run the container with most of the environment variables for connecting to your local docker server. Note that DOCKER_OPTIONS is not set, and that it bind mounts the local docker socket:
docker run --rm \
-e PROCESS=starter \
-e REDIS_HOST=redis \
-e REDIS_PORT=6379 \
-e REDIS_PASSWORD=value \
-e DOCKER_TIMEOUT=5000 \
-e DOCKER_PULL=true \
-e DOCKER_PULL_TIMEOUT=10000 \
-e NODE_ENV=value \
-e LOG_LEVEL=info \
-e LOG_FILE=/var/log/correctomatic/correctomatic.log \
-e CONCURRENT_NOTIFIERS=10 \
-v /var/run/docker.sock:/var/run/docker.sock \
correctomatic/runnerFor that to work, the user running the container must have access to the docker socket. You will need to build the image with the DOCKER_GROUP_ID build argument set to the docker group id in the host. For example, if the docker group id in your local machine is 999:
./build.sh --build-arg DOCKER_GROUP_ID=999Build the image with ./build.sh. All the parameters passed to the script will be passed to the docker build command. For example, to build the image with a custom tag:
./build.sh --no-cache --tag correctomatic/runner:custom-tagTake in account that some parameters are fixed in the script, like the git repository and the docker version to install in the image, which are defined in the .env file in this repository.