mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
The SIH image is the canonical PX4 SITL container, so drop the redundant -sih suffix and publish it as px4io/px4-sitl. Gazebo continues to publish as px4io/px4-sitl-gazebo. Decouples the published image name from the matrix.image identifier by introducing a matrix.repo field, so renames like this don't require touching the matrix logic. This is a breaking change for anyone pulling px4io/px4-sitl-sih directly; the old tags remain available but no new ones will be published under that name. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
50 lines
1.7 KiB
Docker
50 lines
1.7 KiB
Docker
# syntax=docker/dockerfile:1
|
|
# PX4 SITL SIH runtime image
|
|
# Minimal container that runs PX4 with the SIH physics engine (no Gazebo).
|
|
#
|
|
# Build:
|
|
# make px4_sitl_sih && cd build/px4_sitl_sih && cpack -G DEB && cd ../..
|
|
# docker build -f Tools/packaging/Dockerfile.sih -t px4io/px4-sitl:v1.17.0 build/px4_sitl_sih/
|
|
#
|
|
# Run (Linux):
|
|
# docker run --rm -it --network host px4io/px4-sitl:v1.17.0
|
|
#
|
|
# Run (macOS / Windows):
|
|
# docker run --rm -it -p 14550:14550/udp -p 14540:14540/udp -p 19410:19410/udp -p 8888:8888/udp px4io/px4-sitl:v1.17.0
|
|
|
|
FROM ubuntu:24.04 AS build
|
|
COPY px4_*.deb /tmp/
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
apt-get update \
|
|
&& apt-get install -y --no-install-recommends binutils \
|
|
&& dpkg -x /tmp/px4_*.deb /staging \
|
|
&& strip /staging/opt/px4/bin/px4
|
|
|
|
FROM ubuntu:24.04
|
|
LABEL maintainer="PX4 Development Team"
|
|
LABEL description="PX4 SITL with SIH physics (no simulator dependencies)"
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
|
apt-get update && apt-get install -y --no-install-recommends bc
|
|
|
|
COPY --from=build /staging/opt/px4 /opt/px4
|
|
RUN ln -sf /opt/px4/bin/px4 /usr/bin/px4
|
|
|
|
# Platform-adaptive entrypoint: detects Docker Desktop (macOS/Windows) via
|
|
# host.docker.internal and configures MAVLink + DDS to target the host.
|
|
COPY px4-entrypoint.sh /opt/px4/bin/px4-entrypoint.sh
|
|
RUN chmod +x /opt/px4/bin/px4-entrypoint.sh
|
|
|
|
ENV PX4_SIM_MODEL=sihsim_quadx
|
|
ENV HOME=/root
|
|
|
|
# MAVLink (QGC, MAVSDK), DDS (ROS 2), jMAVSim/viewer display
|
|
EXPOSE 14550/udp 14540/udp 19410/udp 8888/udp
|
|
|
|
WORKDIR /root
|
|
|
|
ENTRYPOINT ["/opt/px4/bin/px4-entrypoint.sh"]
|
|
CMD []
|