Skip to main content

A rocker extension to install EtherCAT Master IgH (EtherLab) inside a Docker image.

Project description

etherlab_rocker

A rocker extension that installs the EtherCAT Master IgH (EtherLab) userspace library from source inside a Docker image and forwards the master device and configuration into the container.

The extension clones a chosen tag or branch of EtherLab EtherCAT master from https://gitlab.com/etherlab.org/ethercat.git, builds it with --disable-kernel (userspace-only), and installs it under /usr/local/etherlab.

In addition, the /dev/EtherCAT<idx> device is exposed to the container via --device and the EtherLab config/etc/sysconfig/ethercat is bind-mounted (read-only) into the container automatically.

Missing features:

  • Multiple EtherCAT devices (multi-master setup);
  • EtherLab repos URL as an argument;
  • Master launch at startup, i.e., run sudo /etc/init.d/ethercat start in host.

Prerequisites: kernel module on the host

Because this extension builds EtherLab with --disable-kernel, no kernel module is compiled inside the container. The ec_master kernel module must be built and loaded on the host machine before starting the container. The userspace library communicates with the master through the exposed /dev/EtherCAT* device.

Installation

From PyPI

pip install etherlab-rocker

From source (development)

git clone https://github.com/tpoignonec/etherlab_rocker.git

# Virtual environment
sudo apt install python3-venv
python3 -m venv .venv
source .venv/bin/activate

# Install package
pip install -e ./etherlab_rocker

Usage

sudo apt-get install python3-rocker

rocker --etherlab [--etherlab-version <version>] [--ethercat-master-idx <idx>] <base-image> [command]

Arguments

Argument Default Description
--etherlab Enable the extension (required)
--etherlab-version stable-1.5 Any git tag or branch of the EtherLab repository (e.g. stable-1.5, 1.6.1, etc.). Use none to skip installation and only forward devices and config
--ethercat-master-idx 0 Index of the /dev/EtherCAT<idx> device to forward into the container. Set to -1 to disable device forwarding

Examples

Basic — install EtherLab stable-1.5 (default) and open a shell:

rocker --etherlab ubuntu:24.04 bash

Use a specific tag or branch:

rocker --etherlab --etherlab-version stable-1.6 ubuntu:24.04 bash

Explicit master device index:

rocker --etherlab --ethercat-master-idx 1 ubuntu:24.04 bash

Note that no value is the same as 0.

Skip installation (use a pre-built image that already has EtherLab):

rocker --etherlab --etherlab-version none my-prebuilt-image bash

Disable device forwarding (build/test only, no hardware):

rocker --etherlab --ethercat-master-idx -1 ubuntu:24.04 bash

Test the connection to the EtherCAT master

Once inside the container:

# List slaves on the bus
ethercat slaves

# Show master state
ethercat master

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etherlab_rocker-0.0.1.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etherlab_rocker-0.0.1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file etherlab_rocker-0.0.1.tar.gz.

File metadata

  • Download URL: etherlab_rocker-0.0.1.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etherlab_rocker-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1a9c62eee8b2bb22f46ae2805c17fe8f9b9cd4ab1e6fb1300fc0560702eb00e2
MD5 20d163d8feabc63b11e514bdf495e31e
BLAKE2b-256 23f352834d420a2aaa5434949553b0151ff451426427ecf19ce22a1a24c520a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for etherlab_rocker-0.0.1.tar.gz:

Publisher: publish.yaml on tpoignonec/etherlab_rocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file etherlab_rocker-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for etherlab_rocker-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7fb9503abb2b6cc60e0b267352629c08d9bf7e45b61f4f3c75029d78a44fb9f1
MD5 e3755531525fd16219fabc1e5a693cc8
BLAKE2b-256 529c601aa23acb8e47d1abdd62b86f9296d3422c152948d5747467558625b038

See more details on using hashes here.

Provenance

The following attestation bundles were made for etherlab_rocker-0.0.1-py3-none-any.whl:

Publisher: publish.yaml on tpoignonec/etherlab_rocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page