Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docker/Dockerfile_base-jammy
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
FROM ubuntu:22.04
LABEL maintainer="Ramon Roche <rroche@linuxfoundation.com>"

ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
ant \
Expand Down Expand Up @@ -47,7 +47,6 @@ RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
python3 \
python3-dev \
python3-pip \
python3-venv \
rsync \
screen \
shellcheck \
Expand Down Expand Up @@ -80,7 +79,7 @@ RUN python3 -m pip install --upgrade pip wheel setuptools
# Python 3 dependencies installed by pip
RUN python3 -m pip install argparse argcomplete coverage cerberus empy==3.3.4 jinja2 kconfiglib \
matplotlib>=3.0.* numpy nunavut>=1.1.0 packaging pkgconfig pyros-genmsg pyulog \
pyyaml requests serial six toml psutil pyulog wheel jsonschema pynacl lxml
pyyaml requests pyserial six toml psutil pyulog wheel jsonschema pynacl lxml

#RUN python3 -m pip install argcomplete argparse>=1.2 cerberus coverage empy>=3.3 future \
#jinja2>=2.8 jsonschema kconfiglib lxml matplotlib>=3.0.* numpy>=1.13 nunavut>=1.1.0 \
Expand All @@ -98,15 +97,16 @@ RUN wget -q https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1
&& rm -rf /tmp/*

# create user with id 1001 (jenkins docker workflow default)
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout,plugdev user

# setup virtual X server
RUN mkdir /tmp/.X11-unix && \
chmod 1777 /tmp/.X11-unix && \
chown -R root:root /tmp/.X11-unix
ENV DISPLAY :99
ENV DISPLAY=:99

ENV CCACHE_UMASK=000
ENV FASTRTPSGEN_DIR="/usr/local/bin/"
ENV PATH="/usr/lib/ccache:$PATH"
ENV TERM=xterm
ENV TZ=UTC
Expand Down
13 changes: 6 additions & 7 deletions docker/Dockerfile_base-noble
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
FROM ubuntu:24.04
LABEL maintainer="Alexander Lerach <alexander@auterion.com>"

ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
ant \
Expand Down Expand Up @@ -47,7 +47,6 @@ RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
python3 \
python3-dev \
python3-pip \
python3-venv \
rsync \
screen \
shellcheck \
Expand Down Expand Up @@ -77,7 +76,7 @@ RUN cd /usr/src/gtest \
# Python 3 dependencies installed by pip
RUN python3 -m pip install --break-system-packages argparse argcomplete coverage cerberus empy==3.3.4 jinja2 kconfiglib \
matplotlib>=3.0.* numpy nunavut>=1.1.0 packaging pkgconfig pyros-genmsg pyulog \
pyyaml requests serial six toml psutil pyulog wheel jsonschema pynacl lxml
pyyaml requests pyserial six toml psutil pyulog wheel jsonschema pynacl lxml

# manual ccache setup
RUN ln -s /usr/bin/ccache /usr/lib/ccache/cc \
Expand All @@ -90,13 +89,13 @@ RUN wget -q https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1
&& rm -rf /tmp/*

# create user with id 1001 (jenkins docker workflow default)
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout,plugdev user

# setup virtual X server
RUN mkdir /tmp/.X11-unix && \
chmod 1777 /tmp/.X11-unix && \
chown -R root:root /tmp/.X11-unix
ENV DISPLAY :99
ENV DISPLAY=:99

ENV CCACHE_UMASK=000
ENV PATH="/usr/lib/ccache:$PATH"
Expand Down
12 changes: 8 additions & 4 deletions docker/Dockerfile_nuttx-jammy
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# PX4 NuttX development environment in Ubuntu 20.04 Focal
# PX4 NuttX development environment in Ubuntu 22.04 Jammy
#
# PR for base image author as px4io for replacing me.
#

FROM px4io/px4-dev-base-jammy:2024-05-18
LABEL maintainer="Ramón Roche <rroche@linuxfoundation.org>"
FROM i3salng/px4-dev-base-jammy:2026-01-27
LABEL maintainer="Antoine Nguyen <antoine.nguyen@cnrs.fr>"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
Expand Down Expand Up @@ -47,5 +49,7 @@ RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \

# bloaty - https://github.com/google/bloaty
RUN git clone --recursive https://github.com/google/bloaty.git /tmp/bloaty \
&& cd /tmp/bloaty && cmake -GNinja . && ninja -j $(nproc) bloaty && cp bloaty /usr/local/bin/ \
&& cd /tmp/bloaty && cmake -B bloaty -G Ninja -S . \
&& ninja -C bloaty -j $(nproc) bloaty \
&& cp bloaty/bloaty /usr/local/bin/ \
&& rm -rf /tmp/*
10 changes: 7 additions & 3 deletions docker/Dockerfile_nuttx-noble
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#
# PX4 NuttX development environment in Ubuntu 24.04 Noble
#
# PR for base image author as px4io for replacing me.
#

FROM px4io/px4-dev-base-noble:2025-02-10
LABEL maintainer="Alexander Lerach <alexander@auterion.com>"
FROM i3salng/px4-dev-base-noble:2026-01-26
LABEL maintainer="Antoine Nguyen <antoine.nguyen@cnrs.fr>"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
Expand Down Expand Up @@ -47,5 +49,7 @@ RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \

# bloaty - https://github.com/google/bloaty
RUN git clone --recursive https://github.com/google/bloaty.git /tmp/bloaty \
&& cd /tmp/bloaty && cmake -GNinja . && ninja -j $(nproc) bloaty && cp bloaty /usr/local/bin/ \
&& cd /tmp/bloaty && cmake -B bloaty -G Ninja -S . \
&& ninja -C bloaty -j $(nproc) bloaty \
&& cp bloaty/bloaty /usr/local/bin/ \
&& rm -rf /tmp/*
27 changes: 25 additions & 2 deletions docker/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/bin/bash
set -e

USER_NAME=user
TARGET_UID=${LOCAL_USER_ID:-1000}

# From Ubuntu 24.04 there is existing UID 1000 for ubuntu user/group.
# Detect if it is in conflict with $LOCAL_USER_ID:
detectUIDConflict() {
USER_NAME=user
TARGET_UID=${LOCAL_USER_ID:-1000}

# Check if UID is already taken
EXISTING_USER=$(getent passwd "$TARGET_UID" | cut -d: -f1 || true)

if [ -n "$EXISTING_USER" ] && [ "$EXISTING_USER" != "$USER_NAME" ]; then
echo "UID $TARGET_UID already belongs to $EXISTING_USER — removing it"
userdel "$EXISTING_USER" || true
fi
}

# Start virtual X server in the background
# - DISPLAY default is :99, set in dockerfile
Expand All @@ -18,8 +37,12 @@ fi
# Use the LOCAL_USER_ID if passed in at runtime
if [ -n "${LOCAL_USER_ID}" ]; then
echo "Starting with UID : $LOCAL_USER_ID"
# modify existing user's id
usermod -u $LOCAL_USER_ID user
# If UID conflicts, delete system user (ubuntu if 24.04)
detectUIDConflict
# Now it's safe to modify existing user's id
usermod -u "$TARGET_UID" "$USER_NAME"
# Fix ownership of home (important!)
chown -R "$TARGET_UID":"$TARGET_UID" "/home/$USER_NAME" || true
# run as user
exec gosu user "$@"
else
Expand Down