RMP in a real-time Docker container in Linux

We’ve set up the RMP EtherCAT Master and Motion Controller to run inside an Ubuntu 24.04 Docker container on a Debian 12 host with a PREEMPT_RT patched kernel, retaining the real-time performance you expect. With our latest iPC, which keeps max latency under 30μs, we can run 4kHz RMP sample rates in the container.

The container also runs rapidserver, allowing you to connect seamlessly with RapidSetupX for configuration and diagnostics. We’ve ensured that the container can access the isolated CPU core where RMP operates, and the capabilities to run real-time threads. Additionally, shared memory access is fully supported, so RapidCode applications can communicate with the containerized RMP, whether they’re running inside or outside the container.

Usage of Phantom Axes
One helpful feature of this setup is the ability to use Phantom axes. This lets you spin up RMP in a test environment without needing the full hardware stack—no drives, no motors—just pure software development. It’s ideal for writing and testing your applications before deploying them on the actual machine.

Below are the Dockerfile and compose.yml configurations to get you up and running.

Step 1: Copy the RMP release

Place rmp_10.5.5-1_amd64.deb (or the latest) in the same directory where the Dockerfile and compose.yml files are located.

Step 2: Specify the RMP Version

Before building the Docker image, you need to specify the RMP version. Replace 10.5.5 with your specific version in the command below.

Step 3: Build and Start the Container

Run the following command to build the Docker image and start the RMP container:

RMP_VERSION=10.5.5 docker-compose up --build -d

This command will set up RMP in the container and start rapidserver, making your system ready to connect with RapidSetupX.

Dockerfile:

FROM ubuntu:24.04

SHELL ["/bin/bash", "-c"]

# RMP version will be passed in as a build argument
ARG RMP_VERSION

# Define the .deb file name using the RMP_VERSION variable
ENV RMP_DEB_FILE="rmp_${RMP_VERSION}-1_amd64.deb"

# Install RMP dependencies
RUN dpkg --add-architecture i386 \
  && apt-get update \
  && apt-get install -y sudo lib32stdc++6 libusb-1.0.0 libyubikey0 libcap2:i386 libicu-dev

# Copy the RMP .deb from the host to the container
COPY ${RMP_DEB_FILE} /tmp/${RMP_DEB_FILE}

# Install RMP
RUN dpkg -i /tmp/${RMP_DEB_FILE}

# Cleanup (remove the .deb file)
RUN rm /tmp/${RMP_DEB_FILE}

# copy the RMP license file from the host to the container after the RMP is installed
COPY myLicense.lic /rsi/rsi.lic

# Use CMD to start the rapidserver since systemctl is not available in the container
CMD sudo /rsi/rapidserver

compose.yml:

version: '3'
services:
  rmp_service:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        RMP_VERSION: ${RMP_VERSION}
    image: rsi/rmp:${RMP_VERSION}
    container_name: rmp_container
    tty: true
    cap_add:
      - SYS_NICE
    ulimits:
      rtprio: 99
    network_mode: host
    volumes:
      - /dev/shm:/dev/shm
    devices:
      - /dev/bus/usb:/dev/bus/usb
    privileged: true