Created
April 15, 2023 11:58
-
-
Save hoffmann-stefan/b951fa204417494e637fc744899e0153 to your computer and use it in GitHub Desktop.
Docker reproduction of https://github.com/ros2-dotnet/ros2_dotnet/issues/97
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
# see https://hub.docker.com/_/ros/ for infos on official ros docker images | |
FROM ros:humble-ros-base-jammy | |
# install dotnet-sdk-6.0 via Ubuntu package manager feeds, | |
# see https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2204 | |
RUN export DEBIAN_FRONTEND=noninteractive \ | |
&& apt-get update \ | |
# Install prerequisites | |
&& apt-get install -y --no-install-recommends \ | |
wget \ | |
dotnet-sdk-6.0 \ | |
\ | |
# Cleanup | |
&& rm -rf /var/lib/apt/lists/* | |
# create workspace and import source code | |
RUN mkdir -p ~/ros2_dotnet_ws/src \ | |
&& cd ~/ros2_dotnet_ws \ | |
&& wget https://raw.githubusercontent.com/ros2-dotnet/ros2_dotnet/master/ros2_dotnet.repos \ | |
&& sed -i 's/foxy/humble/' ros2_dotnet.repos \ | |
&& vcs import ~/ros2_dotnet_ws/src < ros2_dotnet.repos | |
# build workspace | |
RUN . /opt/ros/$ROS_DISTRO/setup.sh \ | |
&& cd ~/ros2_dotnet_ws \ | |
&& colcon build |
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
# build with | |
$ docker build . -t ros2_dotnet:humble-ros-jammy | |
# run container with: | |
$ docker run --rm -it ros2_dotnet:humble-ros-jammy | |
# execute in container | |
$ source ~/ros2_dotnet_ws/install/setup.bash | |
$ ros2 run rcldotnet_examples rcldotnet_listener |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment