Container Setup
Containers offer a consistent software environment, simplifying deployment across systems. This page explains how to use a Mango BoostX™ RoCE AI card from inside a container.
Only the user-space packages go into the container. The kernel modules always stay on the host, so the container shares the host's RDMA device rather than driving the hardware itself.
Before proceeding, confirm that the host-side Mango BoostX™ RoCE AI setup in Software Setup is complete:
(host) ~$ rdma link
link mb_0/1 state ACTIVE physical_state LINK_UP netdev enp5s0np0
The kernel-space packages (mango-drivers and mango-drivers-dkms) must be installed on the host, not inside the container.
Option 1 — Building an Image from a Dockerfile
The container gets its packages from the MangoBoost APT repository, registered the same way as on the host (see Software Setup → Package Installation). Replace <guest-username> and <guest-password> with the credentials provided by contact@mangoboost.io.
FROM ubuntu:24.04
ARG MANGO_REPO_USER=<guest-username>
ARG MANGO_REPO_PASSWORD=<guest-password>
RUN apt update && \
apt install -y --no-install-recommends ca-certificates curl gpg
# 1. APT authentication file
RUN printf 'machine repo.mangoboost.io\nlogin %s\npassword %s\n' \
"$MANGO_REPO_USER" "$MANGO_REPO_PASSWORD" > /etc/apt/auth.conf.d/mango-sdk.conf && \
chmod 600 /etc/apt/auth.conf.d/mango-sdk.conf
# 2. Repository signing key
RUN curl -fsSL https://repo.mangoboost.io/artifactory/api/security/keypair/mb-gpg/public \
| gpg --dearmor > /etc/apt/trusted.gpg.d/mango-sdk.gpg
# 3. APT source
RUN printf 'Enabled: yes\nTypes: deb\nURIs: https://repo.mangoboost.io/artifactory/public-debian\nSuites: noble\nComponents: universe\nSigned-By: /etc/apt/trusted.gpg.d/mango-sdk.gpg\n' \
> /etc/apt/sources.list.d/mango-sdk.sources
# 4. Packages
RUN apt update && \
apt install -y --no-install-recommends \
ibverbs-providers ibverbs-utils rdma-core mango-cli perftest pciutils iproute2
(host) ~$ docker build -t <image-name> .
Suites: noble must match the base image's Ubuntu release; use jammy for a 22.04-based image. ca-certificates, curl, and gpg are installed first because the ubuntu:24.04 image ships none of them.
The package list covers the RDMA data path plus the tools used to inspect it:
| Package | Purpose |
|---|---|
ibverbs-providers, rdma-core | MangoBoost user-space verbs provider. Without it the container cannot open the device at all. |
ibverbs-utils | ibv_devinfo, ibv_devices |
iproute2 | rdma |
mango-cli | mango-ctl. Needs pciutils, which is why that is listed too. |
perftest | ib_write_bw and the other RDMA benchmarks |
If the base image contains packages that conflict with ours (e.g., Mellanox OFED), uninstall them. See Troubleshooting → Uninstall Mellanox OFED.
Option 2 — Building an Image from a Running Container
Start a container from the base image, install the packages inside it, then commit the result.
(host) ~$ docker run -it --name <container-name> ubuntu:24.04 bash
The commands run as root inside the container, so no sudo is needed:
(container) ~$ apt update
(container) ~$ apt install -y --no-install-recommends ca-certificates curl gpg
(container) ~$ tee /etc/apt/auth.conf.d/mango-sdk.conf >/dev/null <<EOF
machine repo.mangoboost.io
login <guest-username>
password <guest-password>
EOF
(container) ~$ chmod 600 /etc/apt/auth.conf.d/mango-sdk.conf
(container) ~$ curl -fsSL \
https://repo.mangoboost.io/artifactory/api/security/keypair/mb-gpg/public \
| gpg --dearmor > /etc/apt/trusted.gpg.d/mango-sdk.gpg
(container) ~$ tee /etc/apt/sources.list.d/mango-sdk.sources >/dev/null <<EOF
Enabled: yes
Types: deb
URIs: https://repo.mangoboost.io/artifactory/public-debian
Suites: noble
Components: universe
Signed-By: /etc/apt/trusted.gpg.d/mango-sdk.gpg
EOF
(container) ~$ apt update
(container) ~$ apt install -y --no-install-recommends \
ibverbs-providers ibverbs-utils rdma-core mango-cli perftest pciutils iproute2
Then commit the container to a new image. Passing the image name to docker commit tags it in one step:
(host) ~$ docker commit <container-name> <image-name>
Running the Container
(host) ~$ docker run -it --network=host --privileged -v /dev:/dev <image-name> bash
All three of these options are required for the Mango BoostX™ RoCE AI interfaces:
--privileged— without it the verbs library cannot open the device (Couldn't get context for the device).--network=host— the RDMA connection is established over the host's interface, so the container must share the host network namespace.-v /dev:/dev— exposes/dev/infinibandand the Mango character devices.
Confirm the device reached the container before running a workload:
(container) ~$ rdma link
link mb_0/1 state ACTIVE physical_state LINK_UP netdev enp5s0np0
(container) ~$ ibv_devinfo -d mb_0
hca_id: mb_0
transport: InfiniBand (0)
...
port: 1
state: PORT_ACTIVE (4)
link_layer: Ethernet
If ibv_devinfo does not list mb_0, the container is missing either --privileged or the MangoBoost verbs provider from ibverbs-providers. For the RDMA benchmarks themselves, see Software Setup → RDMA Functionality Test.