Installing Agents via Docker

The following explains how to install agents via the docker runcommand using an example.

In this example, we will install an agent named myAgent that persists data to /tmp/cybus on the host system.

  • In your terminal, enter the following command using to install an agent. For the IMAGE_TAGvariable, make sure to specify the image version that you want to use for the protocol-mapper agent. For example, 1.7.0.

    • Optional: To run the agent with root permissions, add the parameter --user=root to the docker run command.

For more information on the parameters, see Parameters for Installing Agents via Docker

docker run \
-e CYBUS_AGENT_MODE=distributed \
-e CYBUS_AGENT_NAME=myAgent \
-e CYBUS_MQTT_HOST=10.11.12.13 \
-v /tmp/cybus:/data \
--restart unless-stopped \
--net=host \
--hostname=${HOSTNAME} \
registry.cybus.io/cybus/protocol-mapper:${IMAGE_TAG}

Result: The agent is installed.

Parameters for Installing Agents via Docker

The following parameters are used to install agents via Docker.

ParameterDescription

-e CYBUS_AGENT_MODE=distributed

This sets the agent to run in distributed mode.

-e CYBUS_AGENT_NAME=myAgent

Defines the agent name, which must match the agentName used in the service commissioning file.

-e CYBUS_MQTT_HOST=10.11.12.13

Specifies the IP address of the Connectware instance.

-v /tmp/cybus:/data

Mounts a volume to allow the agent to persist data across restarts.

--restart unless-stopped

Ensures the container automatically restarts after failures.

--net=host

Uses host mode networking for the container.

--hostname=${HOSTNAME}

Assigns a hostname to the container for easier identification.

registry.cybus.io/cybus/protocol-mapper:${IMAGE_TAG}

Specifies the image version to be used for the protocol-mapper agent.

Last updated

Logo

© Copyright 2024, Cybus GmbH