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 startin 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file etherlab_rocker-0.1.0.tar.gz.
File metadata
- Download URL: etherlab_rocker-0.1.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
997c603f4123e1c67d3efb6e92a8b71bdf4f69f024668058b92008bcf59208ce
|
|
| MD5 |
beb9082394a5573e868959f06cc492d0
|
|
| BLAKE2b-256 |
9348d689c0db44e33a24b79429ba328bcc35504099d03770438cb250a6b4a02a
|
Provenance
The following attestation bundles were made for etherlab_rocker-0.1.0.tar.gz:
Publisher:
publish.yaml on tpoignonec/etherlab_rocker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etherlab_rocker-0.1.0.tar.gz -
Subject digest:
997c603f4123e1c67d3efb6e92a8b71bdf4f69f024668058b92008bcf59208ce - Sigstore transparency entry: 1188878432
- Sigstore integration time:
-
Permalink:
tpoignonec/etherlab_rocker@57ef880aaaff1cc53f04eb738dfec76fdd074294 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tpoignonec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@57ef880aaaff1cc53f04eb738dfec76fdd074294 -
Trigger Event:
release
-
Statement type:
File details
Details for the file etherlab_rocker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: etherlab_rocker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3125f36afa0ecb2e73975f274bb22f242ff19bc2f2e07c02f73328712b1fb4c
|
|
| MD5 |
ff94e84d661ee2d336a94b3ee936cca7
|
|
| BLAKE2b-256 |
c22b9a82ca59d296713f4c1f43b350d4d29abf6c2ff65d04f7ad27b4dd32d2af
|
Provenance
The following attestation bundles were made for etherlab_rocker-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on tpoignonec/etherlab_rocker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
etherlab_rocker-0.1.0-py3-none-any.whl -
Subject digest:
f3125f36afa0ecb2e73975f274bb22f242ff19bc2f2e07c02f73328712b1fb4c - Sigstore transparency entry: 1188878441
- Sigstore integration time:
-
Permalink:
tpoignonec/etherlab_rocker@57ef880aaaff1cc53f04eb738dfec76fdd074294 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/tpoignonec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@57ef880aaaff1cc53f04eb738dfec76fdd074294 -
Trigger Event:
release
-
Statement type: