Files
PX4-Autopilot/Tools/setup/Dockerfile
T
Ramon Roche a7aecfb9fb build(container): bake optional requirements into px4-dev image
The Dockerfile only ever copied requirements.txt, so optional-requirements.txt
was never installed into the image even though it sits in the build context.
Every CI job needing pyelftools therefore fetched it from PyPI at job time and
failed whenever files.pythonhosted.org returned 502s.

symforce publishes no Linux aarch64 wheel and no sdist, so installing the file
unguarded would break the linux/arm64 image build. Gate it with an environment
marker so aarch64 installs pyelftools only.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Ramon Roche <mrpollo@gmail.com>
2026-08-18 15:13:33 -07:00

43 lines
1.2 KiB
Docker

# PX4 base development environment
FROM ubuntu:24.04
LABEL maintainer="Daniel Agar <daniel@agar.ca>, Ramon Roche <mrpollo@gmail.com>"
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV DISPLAY=:99
ENV TERM=xterm
ENV TZ=UTC
ENV RUNS_IN_DOCKER=true
# SITL UDP PORTS
EXPOSE 14556/udp
EXPOSE 14557/udp
# Install Shell Script Entrypoint
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
# Install PX4 Requirements
COPY requirements.txt /tmp/requirements.txt
COPY ubuntu.sh /tmp/ubuntu.sh
RUN bash /tmp/ubuntu.sh --no-sim-tools
# Install the optional tooling requirements as well, so CI jobs that need them
# (itcm_check) don't have to reach out to PyPI on every run.
COPY optional-requirements.txt /tmp/optional-requirements.txt
RUN python3 -m pip install --break-system-packages -r /tmp/optional-requirements.txt
# Make sure git is ok with your local copy
RUN git config --global --add safe.directory '*'
# Create user with id 1001 (jenkins docker workflow default)
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
ENV PATH="${PATH}:/opt/xtensa-esp-elf/bin"
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["/bin/bash"]