Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile for 2023 MWES #67

Merged
merged 1 commit into from
Jul 14, 2023
Merged
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
61 changes: 61 additions & 0 deletions mwes/2023/vrx_2023_mwes/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
FROM ros:humble-ros-base-jammy

# Set up timezone
ENV TZ=Etc/UTC
RUN echo $TZ > /etc/timezone && \
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime

# Install required utilities
RUN apt update \
&& apt install -y --no-install-recommends \
build-essential \
cmake \
git \
gnupg2 \
lsb-release \
nano \
python3-dbg \
python3-setuptools \
python3-vcstool \
ruby \
sudo \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& apt clean -qq

# Set up locale
RUN sudo apt update && sudo apt install locales \
&& sudo locale-gen en_US en_US.UTF-8 \
&& sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8

ARG ROSDIST=humble
ARG GZDIST=garden
ENV GZ_VERSION garden

# Set up repo to install Ignition
RUN /bin/sh -c 'wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg' \
&& /bin/sh -c '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'


# Install Gazebo (needed for message imports with ros-humble-ros-gzgarden)
RUN apt update \
&& apt install -y --no-install-recommends \
gz-${GZDIST} \
&& rm -rf /var/lib/apt/lists/* \
&& apt clean -qq

# Install example ROS package
RUN apt update \
&& apt install -y --no-install-recommends \
ros-${ROSDIST}-actuator-msgs \
ros-${ROSDIST}-ros-gzgarden \
&& rm -rf /var/lib/apt/lists/* \
&& apt clean -qq

# Copy over script to Docker container
COPY ./run_my_system.bash /

# Use your ros_entrypoint
COPY ./ros_entrypoint.sh /

COPY ./wamv_demo.py /
7 changes: 7 additions & 0 deletions mwes/2023/vrx_2023_mwes/ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e

# setup ros environment
source "/opt/ros/$ROS_DISTRO/setup.bash"

/run_my_system.bash
6 changes: 6 additions & 0 deletions mwes/2023/vrx_2023_mwes/run_my_system.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Start ROS2 daemon for discovery if not already started
ros2 topic list

python3 wamv_demo.py
File renamed without changes.