Skip to content

GPS Docker

You can run the XRT GPS Device Service in a docker container.

The following examples use the iotechsys/xrt:2.0 docker image.

You can run the XRT docker container on either of the following networks:

  • Host
  • Docker bridge

Run on Host Network

In the following example xrt-gps provides the name of the running container, provides the location of the config, state and profiles folders. [time_in_seconds] can optionally define the time for which XRT is to run in seconds:

docker run --rm --network=host --name xrt-gps -v <deployment_directory>/deployment:/opt/iotech/xrt/deployment iotechsys/xrt:2.0 [time_in_seconds]

Run on Docker Bridge Network

When running the GPS Service on a Docker bridge network and connecting to a GPSD instance that is not running on the same network the port should be exposed as follows:

--port <gpsd_port>:<device_port>

Where gpsd_port is the port of the GPSD instance and device_port is the port used by a device added to the GPS Service.

In the following example command the network flag is set to <docker_bridge_network>, specifying the docker network to connect to, xrt-gps provides the name of the running container, <deployment_directory> provides the location of the config folder, and [time_in_seconds] can optionally define the time for which XRT is to run in seconds:

docker run --rm --name xrt-gps --port <gpsd_port>:<device_port> -v <deployment_directory>/deployment:/opt/iotech/xrt/deployment \
    --network <docker_bridge_network> iotechsys/xrt:2.0 [timeout in secs]

Note

If the network flag is not included in the command, the default bridge network is used.

Back to top