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
40 changes: 15 additions & 25 deletions docker/gazebo/gazeboserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,32 @@ WORKDIR ${AMENT_WS}/src
# Copy in source code
COPY src/gazebo gazebo

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
(rosdep install --from-paths . --ignore-src -r -s || true) \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list
rosdep install --from-paths . --ignore-src -r -s \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

################################# Dependencies ################################
FROM ${BASE_IMAGE} AS dependencies
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get update && apt-get install -y --no-install-recommends lsb-release curl gnupg && \
curl --progress-bar https://packages.osrfoundation.org/gazebo.gpg -o /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
RUN apt-get update && \
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 lsb-release wget gnupg && \
wget -q https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null && \
apt-get -y update && \
apt-get -y install --no-install-recommends "ros-${ROS_DISTRO}-ros-gz" ignition-fortress && \
echo "$GAZEBO_PLUGIN_PATH=/opt/ros/humble/lib" && \
apt-get update && \
apt-get install -y --no-install-recommends ros-"$ROS_DISTRO"-ros-gz ignition-fortress && \
rm -rf /var/lib/apt/lists/*
ENV GAZEBO_PLUGIN_PATH=/opt/ros/humble/lib

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN if [ -s /tmp/colcon_install_list ] && ! grep -q "^#" /tmp/colcon_install_list; then \
xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends; \
fi
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -59,9 +49,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
56 changes: 9 additions & 47 deletions docker/robot/robot.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ FROM ${BASE_IMAGE} AS source

WORKDIR ${AMENT_WS}/src

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*

# Copy in source code
# COPY src/robot/yolo_inference ./yolo_inference
# COPY src/robot/object_detection object_detection
Expand All @@ -22,39 +18,25 @@ COPY src/robot/planner planner
COPY src/robot/control control
COPY src/robot/bringup_robot bringup_robot

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
RUN apt-get -qq update && rosdep update && \
(rosdep install --from-paths . --ignore-src -r -s || true) \
rosdep install --from-paths . --ignore-src -r -s \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list || echo "# No additional dependencies needed" > /tmp/colcon_install_list
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

################################# Dependencies ################################
FROM ${BASE_IMAGE} AS dependencies

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*

# Clean up and update apt-get, then update rosdep
RUN apt-get clean && \
apt-get update && \
rosdep update && \
rm -rf /var/lib/apt/lists/*
# ADD MORE DEPENDENCIES HERE

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN apt-get -qq update && \
(if [ -s /tmp/colcon_install_list ] && ! grep -q "^#" /tmp/colcon_install_list; then \
xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends; \
fi) && \
apt-get -qq install -y --no-install-recommends ros-humble-librealsense2* && \
rm -rf /var/lib/apt/lists/*
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
# WORKDIR ${AMENT_WS}/src
# COPY src/robot/object_detection object_detection
WORKDIR ${AMENT_WS}
COPY --from=source ${AMENT_WS}/src src

Expand All @@ -66,31 +48,11 @@ RUN apt-get -qq autoremove -y && apt-get -qq autoclean && apt-get -qq clean && \
################################ Build ################################
FROM dependencies AS build

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*

# Clean up and update apt-get, then update rosdep
RUN apt-get clean && \
apt-get update && \
rosdep update && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install --no-install-recommends -y \
python3-pip \
python3-dev \
python3-setuptools \
&& rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
#RUN pip install --no-cache-dir onnxruntime && pip3 install --no-cache-dir "numpy<2.0"

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
13 changes: 5 additions & 8 deletions docker/samples/cpp_aggregator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ WORKDIR ${AMENT_WS}/src
COPY src/samples/cpp/aggregator aggregator
COPY src/wato_msgs/sample_msgs sample_msgs

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
rosdep install --from-paths . --ignore-src -r -s \
| grep 'apt-get install' \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

Expand All @@ -26,7 +23,7 @@ FROM ${BASE_IMAGE} AS dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -42,9 +39,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
14 changes: 5 additions & 9 deletions docker/samples/cpp_producer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ WORKDIR ${AMENT_WS}/src
COPY src/samples/cpp/producer producer
COPY src/wato_msgs/sample_msgs sample_msgs

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
rosdep install --from-paths . --ignore-src -r -s \
| grep 'apt-get install' \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

Expand All @@ -27,7 +23,7 @@ FROM ${BASE_IMAGE} AS dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -43,9 +39,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
13 changes: 5 additions & 8 deletions docker/samples/cpp_transformer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ WORKDIR ${AMENT_WS}/src
COPY src/samples/cpp/transformer transformer
COPY src/wato_msgs/sample_msgs sample_msgs

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
rosdep install --from-paths . --ignore-src -r -s \
| grep 'apt-get install' \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

Expand All @@ -26,7 +23,7 @@ FROM ${BASE_IMAGE} AS dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -42,9 +39,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
13 changes: 5 additions & 8 deletions docker/samples/py_aggregator.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ WORKDIR ${AMENT_WS}/src
COPY src/samples/python/aggregator aggregator
COPY src/wato_msgs/sample_msgs sample_msgs

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
rosdep install --from-paths . --ignore-src -r -s \
| grep 'apt-get install' \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

Expand All @@ -26,7 +23,7 @@ FROM ${BASE_IMAGE} AS dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -42,9 +39,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
13 changes: 5 additions & 8 deletions docker/samples/py_producer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ WORKDIR ${AMENT_WS}/src
COPY src/samples/python/producer producer
COPY src/wato_msgs/sample_msgs sample_msgs

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
rosdep install --from-paths . --ignore-src -r -s \
| grep 'apt-get install' \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

Expand All @@ -26,7 +23,7 @@ FROM ${BASE_IMAGE} AS dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -42,9 +39,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
13 changes: 5 additions & 8 deletions docker/samples/py_transformer.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@ WORKDIR ${AMENT_WS}/src
COPY src/samples/python/transformer transformer
COPY src/wato_msgs/sample_msgs sample_msgs

RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Scan for rosdeps
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get -qq update && rosdep update && \
rosdep install --from-paths . --ignore-src -r -s \
| grep 'apt-get install' \
| (grep 'apt-get install' || true) \
| awk '{print $3}' \
| sort > /tmp/colcon_install_list

Expand All @@ -26,7 +23,7 @@ FROM ${BASE_IMAGE} AS dependencies

# Install Rosdep requirements
COPY --from=source /tmp/colcon_install_list /tmp/colcon_install_list
RUN xargs -a /tmp/colcon_install_list apt-fast install -qq -y --no-install-recommends
RUN apt-fast install -qq -y --no-install-recommends "$(cat /tmp/colcon_install_list)"

# Copy in source code from source stage
WORKDIR ${AMENT_WS}
Expand All @@ -42,9 +39,9 @@ FROM dependencies AS build

# Build ROS2 packages
WORKDIR ${AMENT_WS}
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \
RUN . /opt/ros/"$ROS_DISTRO"/setup.sh && \
colcon build \
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "${WATONOMOUS_INSTALL}"
--cmake-args -DCMAKE_BUILD_TYPE=Release --install-base "$WATONOMOUS_INSTALL"

# Source and Build Artifact Cleanup
RUN rm -rf src/* build/* devel/* install/* log/*
Expand Down
Loading