mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 01:17:51 +08:00
build(sim): resolve SITL runtime deps via .deb Depends
The px4-gazebo .deb already declares OpenCV and gstreamer core library deps via dpkg-shlibdeps, but Dockerfile.gazebo uses dpkg -x which bypasses resolution. Switch to apt install ./px4-gazebo_*.deb so Depends are resolved automatically. Add the 5 gstreamer plugin packages (plugins-base/good/bad/ugly/libav) to CPACK_DEBIAN_PACKAGE_DEPENDS since they're loaded at runtime via gst_element_factory_make() and cannot be detected by shlibdeps. Apply the same apt-install pattern to Dockerfile.sih so both images build consistently. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
@@ -11,26 +11,34 @@
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# Persist flight logs on the host (ulog files):
|
||||
# mkdir -p ./px4-logs
|
||||
# docker run --rm -it --network host \
|
||||
# -v $(pwd)/px4-logs:/root/.local/share/px4/rootfs/log \
|
||||
# px4io/px4-sitl:v1.17.0
|
||||
|
||||
FROM ubuntu:24.04
|
||||
LABEL maintainer="PX4 Development Team"
|
||||
LABEL description="PX4 SITL with SIH physics (no simulator dependencies)"
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install px4 via apt so Depends: are resolved automatically. The binary is
|
||||
# stripped after install to trim image size (~a few MB).
|
||||
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 bc
|
||||
|
||||
COPY --from=build /staging/opt/px4 /opt/px4
|
||||
RUN ln -sf /opt/px4/bin/px4 /usr/bin/px4
|
||||
apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
/tmp/px4_*.deb \
|
||||
bc \
|
||||
binutils \
|
||||
&& strip /opt/px4/bin/px4 \
|
||||
&& apt-get purge -y binutils \
|
||||
&& apt-get autoremove -y \
|
||||
&& rm -f /tmp/px4_*.deb \
|
||||
&& 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.
|
||||
|
||||
Reference in New Issue
Block a user