🛠 Docker dès la sortie de l'emballage : premier conteneur sur le Linux embarqué
Objectives
The true superpower of the X8: its embedded Linux (Linux microPlatform, Foundries.io Yocto distribution) ships with Docker preinstalled. Applications run in containers decoupled from the OS — modular deployment, incremental OTA, ready-to-use images on the arduino Docker Hub. You will launch your first container, understand the docker permissions story, and pull an official Arduino image.
Hardware
- 1 × Arduino Portenta X8 powered via USB-C
- PC with adb (board visible via
adb devices) - Internet connection on the board's network (Wi-Fi or Ethernet via carrier board — see the network tutorial; by default the X8 has no bare RJ45)
- 16 GB embedded eMMC: Docker images fit comfortably
Complete code
# Depuis le PC :
adb shell
# fio@portenta-x8:~$
# Permission docker : la doc officielle recommande d'abord :
newgrp - docker
# Le test canonique, fonctionne out of the box :
docker run hello-world
# -> "Hello from Docker! This message shows that your installation...
# Images officielles Arduino sur Docker Hub (org « arduino ») :
docker pull arduino/python-rpc-serial
# Lancer le conteneur officiel du tuto python-arduino-data-exchange :
docker run -d \
--name python-rpc-serial \
--restart unless-stopped \
-e PYTHONUNBUFFERED=1 \
--tty \
--read-only \
-p 5002-5020:5002-5020 \
-v /tmp:/tmp \
--device /dev/ttyGS0 \
arduino/python-rpc-serial
# Inventaire local
docker images
docker ps -a
Expected verification
docker run hello-world displays the welcome message in a few seconds (download included) — proof that the Docker daemon, eMMC storage, and network are working. The arduino/python-rpc-serial container starts in the background (docker ps lists it as "Up"): it exposes RPC ports 5002-5020 and the serial device /dev/ttyGS0, the gateway to the M4 sketch in the next tutorial.
Common errors
permission deniedon/var/run/docker.sock: this is THE documented pitfall — runnewgrp - dockerin your adb session before any docker command (otherwise switch to root).- Believing that containers persist after deleting an image:
docker rm+docker rmireally delete them; to return to a clean system, the official procedure is reflashing the image (image-flashing tutorial). docker pullfailing: no network! The bare board has neither RJ45 nor an Ethernet cable — first verify that Wi-Fi or Ethernet on the carrier board is mounted (network tutorial).- A
--read-onlycontainer complaining when writing to /tmp: this is why the official image mounts-v /tmp:/tmpas read/write — do not remove this mount. - Confusing it with a Raspberry Pi: here there is no apt or RaspiOS, it is Yocto; system packages are managed at image build time (or
opkgfor test packages), not with a classic package manager. - >
Other tutorials for this board
- Premiers pas : comprendre le monstre à 9 cœurs et entrer dans Linux via ADB
- Premier sketch sur le cœur M4 : le blink qui se flash par ADB
- Pont Linux ↔ Arduino : appeler des fonctions du sketch M4 depuis Python (RPC)
- Mettre la X8 en réseau : Wi-Fi du Murata 1DX et Gigabit Ethernet sur porteuse
- Nœud IoT de datalogging : capteurs sur le M4, stockage et transport en conteneur
- Le firmware caché : mettre à jour le bridge STM32H7 M7 qui expose les périphériques à Linux
Code examples for this board
etat-systeme.shBashgpio-libgpiod.shBashpython-gpio.pyPythondocker-hello.shBashflasher-core-arduino.shBashwifi-nmcli.shBash