Third-party modules via docker-compose

I'm in a project where we're going to need several vms with ignition, and I'm using Docker to create the containers.

In the documentation I saw how to add the desired modules. Would it be possible to add third party modules in docker-compose.yaml?

Or would it be necessary to create an image with these modules?

There are a couple of ways to go about this. The simplest way, if you're using Docker Compose, is to just have a folder (say modules) with the third-party modules you'd like to add. Then, simply bind-mount the individual modules into place under /usr/local/bin/user-lib/modules. It might look something like this:

services:
  gateway1:
    ...
    volumes:
      - gateway1-data:/usr/local/bin/ignition/data
      - ./modules/MQTT-Engine-signed.modl:/usr/local/bin/ignition/user-lib/modules/MQTT-Engine.modl
    ...

Then, when you launch the services, they'll load that module alongside the others that are in that folder (from the base image). Combine this with the GATEWAY_MODULES_ENABLED environment variable to whitelist the other built-in modules as desired.

2 Likes