From 58986efa031a91a7dacc5da4678bdb302d88fcd1 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Tue, 23 Jun 2026 11:32:14 +0200 Subject: [PATCH 1/4] pre-commit update --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f60291c..129f758 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer @@ -20,7 +20,7 @@ repos: - id: check-xml - repo: https://github.com/hadolint/hadolint - rev: v2.12.0 + rev: v2.14.0 hooks: - id: hadolint-docker types: [file] From cb86293923d45c956be2727e986ac62ca71a90b0 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Tue, 23 Jun 2026 12:29:08 +0200 Subject: [PATCH 2/4] all: migrate to ubuntu24.04 base --- docker/Dockerfile_dev-armhf-musl | 18 +++++++++--------- docker/Dockerfile_dev-base | 21 ++++++++++++++++----- docker/Dockerfile_dev-chibios | 14 +++++++------- docker/Dockerfile_dev-clang | 4 ++-- docker/Dockerfile_dev-coverage | 2 +- docker/Dockerfile_dev-periph | 2 +- docker/Dockerfile_dev-ros | 10 +++++++--- 7 files changed, 43 insertions(+), 28 deletions(-) diff --git a/docker/Dockerfile_dev-armhf-musl b/docker/Dockerfile_dev-armhf-musl index e5fc025..7b171af 100644 --- a/docker/Dockerfile_dev-armhf-musl +++ b/docker/Dockerfile_dev-armhf-musl @@ -1,28 +1,28 @@ # syntax=docker/dockerfile:1 ARG TAG="latest" -FROM ardupilot/ardupilot-dev-armhf:${TAG} +FROM ardupilot/ardupilot-dev-armhf:"${TAG}" # Get ArduPilot MUSL ARM toolchain ARG MUSL_ROOT="arm-linux-musleabihf-cross" -ARG MUSL_TARBALL="$MUSL_ROOT.tgz" +ARG MUSL_TARBALL="${MUSL_ROOT}.tgz" # ARG MUSL_TARBALL_URL="https://musl.cc/$MUSL_TARBALL" # Seems prevent github actions from accessing the URL -ARG MUSL_TARBALL_URL="https://github.com/ArduPilot/ardupilot_dev_docker/releases/download/v0.1.4/$MUSL_TARBALL" +ARG MUSL_TARBALL_URL="https://github.com/ArduPilot/ardupilot_dev_docker/releases/download/v0.1.4/${MUSL_TARBALL}" RUN set -eu \ && mkdir -p /opt && cd /opt \ # Download to file with retries to avoid truncated archives - && wget -q --tries=5 --timeout=30 -O "$MUSL_TARBALL" "$MUSL_TARBALL_URL" \ - && test -s "$MUSL_TARBALL" \ - && tar -xzf "$MUSL_TARBALL" \ - && rm -f "$MUSL_TARBALL" \ - && rm -rf "/opt/$MUSL_ROOT/share/doc" + && wget -q --tries=5 --timeout=30 -O "${MUSL_TARBALL}" "${MUSL_TARBALL_URL}" \ + && test -s "${MUSL_TARBALL}" \ + && tar -xzf "${MUSL_TARBALL}" \ + && rm -f "${MUSL_TARBALL}" \ + && rm -rf "/opt/${MUSL_ROOT}/share/doc" # manual ccache setup for new toolchain RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-linux-musleabihf-g++ \ && ln -s /usr/bin/ccache /usr/lib/ccache/arm-linux-musleabihf-gcc # Set MUSL toolchain to the PATH -ENV PATH="/opt/$MUSL_ROOT/bin:$PATH" +ENV PATH="/opt/${MUSL_ROOT}/bin:$PATH" # Set ccache to the PATH ENV PATH="/usr/lib/ccache:$PATH" diff --git a/docker/Dockerfile_dev-base b/docker/Dockerfile_dev-base index 15f76f0..c36fcd4 100644 --- a/docker/Dockerfile_dev-base +++ b/docker/Dockerfile_dev-base @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM ubuntu:22.04 AS base +FROM ubuntu:24.04 AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ @@ -23,6 +23,7 @@ RUN apt-get update \ libxml2-utils \ libxslt1-dev \ openjdk-11-jre-headless \ + python3-dev \ python3-numpy \ python3-pyparsing \ python3-serial \ @@ -35,9 +36,13 @@ RUN apt-get update \ && apt-get autoclean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +ENV PYTHONUNBUFFERED=1 \ + PYTHONDONTWRITEBYTECODE=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=on + # TAKEN from https://github.com/docker-library/python/blob/a58630aef106c8efd710011c6a2a0a1d551319a0/3.11/bullseye/Dockerfile # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION=25.0.1 +ENV PYTHON_PIP_VERSION=26.1.2 # https://github.com/docker-library/python/issues/365 ENV PYTHON_SETUPTOOLS_VERSION=78.1.0 # https://github.com/pypa/get-pip @@ -53,14 +58,19 @@ RUN set -eux; \ --disable-pip-version-check \ --no-cache-dir \ --no-compile \ + --break-system-packages \ "pip==$PYTHON_PIP_VERSION" \ "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ + wheel \ ; \ rm -f get-pip.py; \ \ - pip --version - -RUN python -m pip install --no-cache-dir -U wheel future lxml pexpect flake8 pycodestyle empy==3.3.4 pyelftools tabulate pre-commit junitparser + pip --version; \ + mkdir -p ~/.config/pip \ + && echo "[global]" >> ~/.config/pip/pip.conf \ + && echo "break-system-packages = true" >> ~/.config/pip/pip.conf + +RUN python -m pip install --no-cache-dir -U wheel future lxml pexpect fastcrc flake8 pycodestyle empy==3.3.4 pyelftools tabulate pre-commit junitparser ptyprocess dronecan RUN mkdir -p /__w/ardupilot/ardupilot && git config --global --add safe.directory /__w/ardupilot/ardupilot && git config --system --add safe.directory /__w/ardupilot/ardupilot @@ -97,3 +107,4 @@ ENV TZ=UTC ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 +ENV PIP_DISABLE_PIP_VERSION_CHECK=on diff --git a/docker/Dockerfile_dev-chibios b/docker/Dockerfile_dev-chibios index 76444b2..384c30a 100644 --- a/docker/Dockerfile_dev-chibios +++ b/docker/Dockerfile_dev-chibios @@ -1,17 +1,17 @@ # syntax=docker/dockerfile:1 ARG TAG="latest" -FROM ardupilot/ardupilot-dev-base:${TAG} +FROM ardupilot/ardupilot-dev-base:"${TAG}" # Get ArduPilot STM32 toolchain ARG ARM_ROOT="gcc-arm-none-eabi-10" ARG ARM_ROOT_EXT="-2020-q4-major" -ARG ARM_TARBALL="$ARM_ROOT$ARM_ROOT_EXT-x86_64-linux.tar.bz2" -ARG ARM_TARBALL_URL="https://firmware.ardupilot.org/Tools/STM32-tools/$ARM_TARBALL" +ARG ARM_TARBALL="${ARM_ROOT}${ARM_ROOT_EXT}-x86_64-linux.tar.bz2" +ARG ARM_TARBALL_URL="https://firmware.ardupilot.org/Tools/STM32-tools/${ARM_TARBALL}" RUN mkdir -p /opt && cd /opt \ - && wget -qO- "$ARM_TARBALL_URL" | tar jx \ - && mv "/opt/$ARM_ROOT$ARM_ROOT_EXT" "/opt/$ARM_ROOT" \ - && rm -rf "/opt/$ARM_ROOT/share/doc" + && wget -qO- "${ARM_TARBALL_URL}" | tar jx \ + && mv "/opt/${ARM_ROOT}${ARM_ROOT_EXT}" "/opt/${ARM_ROOT}" \ + && rm -rf "/opt/${ARM_ROOT}/share/doc" RUN python -m pip install --no-cache-dir -U intelhex @@ -20,7 +20,7 @@ RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++ \ && ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc # Set STM32 toolchain to the PATH -ENV PATH="/opt/$ARM_ROOT/bin:$PATH" +ENV PATH="/opt/${ARM_ROOT}/bin:$PATH" RUN ln -s -f /opt/gcc-arm-none-eabi-10/ g++-10.2.1 diff --git a/docker/Dockerfile_dev-clang b/docker/Dockerfile_dev-clang index cf55d34..d69fd50 100644 --- a/docker/Dockerfile_dev-clang +++ b/docker/Dockerfile_dev-clang @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 ARG TAG="latest" -FROM ardupilot/ardupilot-dev-base:${TAG} -ENV CLANG_VERSION=14 +FROM ardupilot/ardupilot-dev-base:"${TAG}" +ENV CLANG_VERSION=18 RUN apt-get update && apt-get install --no-install-recommends -y \ clang-"$CLANG_VERSION" \ diff --git a/docker/Dockerfile_dev-coverage b/docker/Dockerfile_dev-coverage index c52429e..8b27950 100644 --- a/docker/Dockerfile_dev-coverage +++ b/docker/Dockerfile_dev-coverage @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 ARG TAG="latest" -FROM ardupilot/ardupilot-dev-base:${TAG} +FROM ardupilot/ardupilot-dev-base:"${TAG}" RUN apt-get update && apt-get install --no-install-recommends -y \ lcov \ diff --git a/docker/Dockerfile_dev-periph b/docker/Dockerfile_dev-periph index 346dec4..0327117 100644 --- a/docker/Dockerfile_dev-periph +++ b/docker/Dockerfile_dev-periph @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 ARG TAG="latest" -FROM ardupilot/ardupilot-dev-coverage:${TAG} +FROM ardupilot/ardupilot-dev-coverage:"${TAG}" RUN apt-get update && dpkg --add-architecture i386 \ && apt-get update \ diff --git a/docker/Dockerfile_dev-ros b/docker/Dockerfile_dev-ros index dcd58db..6950c7e 100644 --- a/docker/Dockerfile_dev-ros +++ b/docker/Dockerfile_dev-ros @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 ARG ROS_DISTRO=humble -FROM ros:${ROS_DISTRO}-ros-base AS main-setup +FROM ros:"${ROS_DISTRO}"-ros-base AS main-setup ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --no-install-recommends -y \ @@ -32,12 +32,16 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ default-jre \ socat \ ros-dev-tools \ - ros-${ROS_DISTRO}-launch-pytest \ + ros-"${ROS_DISTRO}"-launch-pytest \ && apt-get clean \ && apt-get -y autoremove \ && apt-get autoclean \ && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* +ENV PYTHONUNBUFFERED=1 \ + PYTHONDONTWRITEBYTECODE=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=on + # TAKEN from https://github.com/docker-library/python/blob/a58630aef106c8efd710011c6a2a0a1d551319a0/3.11/bullseye/Dockerfile # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION=25.0.1 @@ -106,7 +110,7 @@ RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++ \ # Set STM32 toolchain to the PATH ENV PATH="/opt/$ARM_ROOT/bin:$PATH" -RUN mkdir -p $HOME/arm-gcc \ +RUN mkdir -p "$HOME"/arm-gcc \ && ln -s -f /opt/gcc-arm-none-eabi-10/ g++-10.2.1 From 414929b7879bcea17225c0d625fb630803584d38 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Thu, 25 Jun 2026 11:26:14 +0200 Subject: [PATCH 3/4] Base: add ppp and unifiy with ROS --- docker/Dockerfile_dev-base | 28 ++++++++++++----------- docker/Dockerfile_dev-ros | 46 ++++++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/docker/Dockerfile_dev-base b/docker/Dockerfile_dev-base index c36fcd4..e6c7c04 100644 --- a/docker/Dockerfile_dev-base +++ b/docker/Dockerfile_dev-base @@ -4,32 +4,33 @@ FROM ubuntu:24.04 AS base ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update \ && apt-get install --no-install-recommends -y \ - lsb-release \ - sudo \ - wget \ - software-properties-common \ astyle \ build-essential \ ccache \ + cmake \ g++ \ - gdb \ gawk \ + gdb \ git \ - make \ - cmake \ - ninja-build \ + libpython3-stdlib \ libtool \ + libtool-bin \ libxml2-dev \ libxml2-utils \ libxslt1-dev \ + lsb-release \ + make \ + ninja-build \ openjdk-11-jre-headless \ + ppp \ + python-is-python3 \ python3-dev \ python3-numpy \ python3-pyparsing \ python3-serial \ - python-is-python3 \ - libpython3-stdlib \ - libtool-bin \ + software-properties-common \ + sudo \ + wget \ zip \ && apt-get clean \ && apt-get -y autoremove \ @@ -70,7 +71,7 @@ RUN set -eux; \ && echo "[global]" >> ~/.config/pip/pip.conf \ && echo "break-system-packages = true" >> ~/.config/pip/pip.conf -RUN python -m pip install --no-cache-dir -U wheel future lxml pexpect fastcrc flake8 pycodestyle empy==3.3.4 pyelftools tabulate pre-commit junitparser ptyprocess dronecan +RUN python -m pip install --no-cache-dir -U wheel future lxml pexpect fastcrc flake8 pycodestyle empy==3.3.4 pyelftools tabulate pre-commit junitparser ptyprocess dronecan requests mock RUN mkdir -p /__w/ardupilot/ardupilot && git config --global --add safe.directory /__w/ardupilot/ardupilot && git config --system --add safe.directory /__w/ardupilot/ardupilot @@ -94,8 +95,9 @@ COPY --from=dds-gen-builder /dds-gen/scripts scripts/ COPY --from=dds-gen-builder /dds-gen/share share/ WORKDIR / +ENV PATH="/dds-gen/scripts:$PATH" # Set ccache to the PATH -ENV PATH="/dds-gen/scripts:/usr/lib/ccache:$PATH" +ENV PATH="/usr/lib/ccache:$PATH" # Gain some time by disabling mavnative ENV DISABLE_MAVNATIVE=True diff --git a/docker/Dockerfile_dev-ros b/docker/Dockerfile_dev-ros index 6950c7e..dad2d58 100644 --- a/docker/Dockerfile_dev-ros +++ b/docker/Dockerfile_dev-ros @@ -4,35 +4,38 @@ FROM ros:"${ROS_DISTRO}"-ros-base AS main-setup ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install --no-install-recommends -y \ - lsb-release \ - sudo \ - wget \ - software-properties-common \ astyle \ build-essential \ ccache \ + cmake \ + default-jre \ g++ \ - gdb \ gawk \ + gdb \ git \ - make \ - cmake \ - ninja-build \ + libpython3-stdlib \ libtool \ + libtool-bin \ libxml2-dev \ libxml2-utils \ libxslt1-dev \ + lsb-release \ + make \ + ninja-build \ + openjdk-11-jre-headless \ + ppp \ + python-is-python3 \ + python3-dev \ python3-numpy \ python3-pyparsing \ python3-serial \ - python-is-python3 \ - libpython3-stdlib \ - libtool-bin \ - zip \ - default-jre \ - socat \ - ros-dev-tools \ ros-"${ROS_DISTRO}"-launch-pytest \ + ros-dev-tools \ + socat \ + software-properties-common \ + sudo \ + wget \ + zip \ && apt-get clean \ && apt-get -y autoremove \ && apt-get autoclean \ @@ -44,9 +47,9 @@ ENV PYTHONUNBUFFERED=1 \ # TAKEN from https://github.com/docker-library/python/blob/a58630aef106c8efd710011c6a2a0a1d551319a0/3.11/bullseye/Dockerfile # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" -ENV PYTHON_PIP_VERSION=25.0.1 +ENV PYTHON_PIP_VERSION=26.1.2 # https://github.com/docker-library/python/issues/365 -ENV PYTHON_SETUPTOOLS_VERSION=65.5.1 +ENV PYTHON_SETUPTOOLS_VERSION=78.1.0 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py @@ -63,12 +66,16 @@ RUN set -eux; \ --break-system-packages \ "pip==$PYTHON_PIP_VERSION" \ "setuptools==$PYTHON_SETUPTOOLS_VERSION" \ + wheel \ ; \ rm -f get-pip.py; \ \ - pip --version + pip --version; \ + mkdir -p ~/.config/pip \ + && echo "[global]" >> ~/.config/pip/pip.conf \ + && echo "break-system-packages = true" >> ~/.config/pip/pip.conf -RUN python -m pip install --no-cache-dir --break-system-packages -U wheel future lxml pexpect flake8 empy==3.3.4 pyelftools tabulate pymavlink pre-commit junitparser +RUN python -m pip install --no-cache-dir -U wheel future lxml pexpect fastcrc flake8 pycodestyle empy==3.3.4 pyelftools tabulate pre-commit junitparser ptyprocess dronecan pymavlink requests mock RUN mkdir -p /__w/ardupilot/ardupilot && git config --global --add safe.directory /__w/ardupilot/ardupilot && git config --system --add safe.directory /__w/ardupilot/ardupilot @@ -128,3 +135,4 @@ ENV TZ=UTC ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 +ENV PIP_DISABLE_PIP_VERSION_CHECK=on From 5f126ce13021564f46c7a5e8f5af401407ba2f45 Mon Sep 17 00:00:00 2001 From: Pierre Kancir Date: Thu, 25 Jun 2026 11:33:37 +0200 Subject: [PATCH 4/4] .github: use DOCKERHUB_TOKEN --- .github/workflows/ros_nightly.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ros_nightly.yml b/.github/workflows/ros_nightly.yml index 40af9a9..80adaef 100644 --- a/.github/workflows/ros_nightly.yml +++ b/.github/workflows/ros_nightly.yml @@ -71,7 +71,7 @@ jobs: uses: docker/login-action@v4 with: username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + password: ${{ secrets.DOCKERHUB_TOKEN }} # Only push if it comes from tagging - name: Build ardupilot-dev-ros images diff --git a/README.md b/README.md index f2a4ca4..690b3b8 100644 --- a/README.md +++ b/README.md @@ -42,4 +42,4 @@ In order to publish them to DockerHub, we need to make a release and tag the ima The repo setting is quite simple, it needs GitHub Action and an account on DockerHub. In order to be able to publish the image on DockerHub, you need to set two secrets on your repo setting : -`DOCKER_USERNAME` and `DOCKER_PASSWORD` +`DOCKER_USERNAME` and `DOCKERHUB_TOKEN`