forked from eProsima/Micro-XRCE-DDS-Agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Re-branched from master (due to long list of merge conflicts) - Building using the Dockerfile and workflow action from feat-multiarch branch - Upgraded SDK and run-time images to latest - Upgraded action components
- Loading branch information
1 parent
8ec812b
commit 865c8b9
Showing
2 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,45 @@ | ||
FROM ghcr.io/tiiuae/fog-ros-baseimage-builder:v2.1.0 AS builder | ||
# Given dynamically from CI job. | ||
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/tiiuae/fog-ros-sdk:sha-6d67ecf-${TARGETARCH:-amd64} AS builder | ||
|
||
COPY . /main_ws/src/ | ||
# Must be defined another time after "FROM" keyword. | ||
ARG TARGETARCH | ||
|
||
# this: | ||
# 1) builds the application | ||
# 2) packages the application as .deb in /main_ws/ | ||
# SRC_DIR environment variable is defined in the fog-ros-sdk image. | ||
# The same workspace path is used by all ROS2 components. | ||
# See: https://github.com/tiiuae/fog-ros-baseimage/blob/main/Dockerfile.sdk_builder | ||
COPY . $SRC_DIR/microxrcedds_agent | ||
|
||
RUN /packaging/build.sh | ||
RUN /packaging/build_colcon_sdk.sh ${TARGETARCH:-amd64} | ||
# Even though it is possible to tar the install directory for retrieving it later in runtime image, | ||
# the tar extraction in arm64 emulated on arm64 is still slow. So, we copy the install directory instead | ||
|
||
# ▲ runtime ──┐ | ||
# └── build ▼ | ||
|
||
FROM ghcr.io/tiiuae/fog-ros-baseimage:v2.1.0 | ||
FROM ghcr.io/tiiuae/fog-ros-baseimage:sha-6d67ecf | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
|
||
HEALTHCHECK --interval=5s \ | ||
CMD fog-health check --metric=messages_from_flightcontroller_count --diff-gte=1.0 \ | ||
--metrics-from=http://localhost:${METRICS_PORT}/metrics --only-if-nonempty=${METRICS_PORT} | ||
|
||
RUN apt-get update && apt-get install -y python3-pip && \ | ||
pip3 install simplejson pystache | ||
RUN apt update \ | ||
&& apt install -y \ | ||
prometheus-cpp \ | ||
civetweb-cpp \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& pip3 install simplejson pystache | ||
|
||
RUN mkdir -p /usr/local/lib \ | ||
&& mkdir -p /usr/local/bin | ||
|
||
ENTRYPOINT /entrypoint.sh | ||
COPY entrypoint.sh /entrypoint.sh | ||
COPY parse_agent_refs.py /parse_agent_refs.py | ||
COPY agent.refs.mustache /agent.refs.mustache | ||
COPY agent.refs /agent.refs | ||
COPY --from=builder /main_ws/install/bin/MicroXRCEAgent /usr/local/bin | ||
COPY --from=builder /main_ws/install/lib/libmicroxrcedds_agent.so.2.2.0 /usr/local/lib | ||
RUN ln -s /usr/local/lib/libmicroxrcedds_agent.so.2.2.0 /usr/local/lib/libmicroxrcedds_agent.so.2.2 \ | ||
&& ln -s /usr/local/lib/libmicroxrcedds_agent.so.2.2 /usr/local/lib/libmicroxrcedds_agent.so | ||
|
||
COPY --from=builder /main_ws/ros-*-microxrce-agent_*_amd64.deb /microxrce-agent.deb | ||
RUN dpkg -i /microxrce-agent.deb && rm /microxrce-agent.deb | ||
ENV PATH="/usr/local/bin:$PATH" \ | ||
LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH" | ||
|
||
COPY entrypoint.sh parse_agent_refs.py agent.refs.mustache agent.refs / |