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

Added docker file and docker compose to dockerize rolling #127

Draft
wants to merge 1 commit into
base: rolling
Choose a base branch
from
Draft
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
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM osrf/ros:rolling-desktop
SHELL ["/bin/bash", "-c"]

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN apt update
COPY . /app/src/rmw_zenoh
WORKDIR /app
RUN rosdep install --from-paths src --ignore-src --rosdistro rolling -y
RUN source /opt/ros/rolling/setup.bash && source "$HOME/.cargo/env" && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["/app/src/rmw_zenoh/entrypoint.sh"]
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
version: '3.2'
services:
router:
build:
context: .
image: zenoh:latest
stdin_open: true
tty: true
container_name: router_container
command: router
volumes:
- /dev/shm:/dev/shm
network_mode: host


talker:
build:
context: .
image: zenoh:latest
stdin_open: true
tty: true
container_name: talker_container
command: talker
volumes:
- /dev/shm:/dev/shm
network_mode: host
depends_on:
- router

listener:
build:
context: .
image: zenoh:latest
stdin_open: true
tty: true
container_name: listener_container
command: listener
volumes:
- /dev/shm:/dev/shm
network_mode: host
depends_on:
- router

21 changes: 21 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

source ./install/setup.bash

if [ $1 = "router" ]
then
ros2 run rmw_zenoh_cpp rmw_zenohd
fi

if [ $1 = "talker" ]
then
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp talker
fi

if [ $1 = "listener" ]
then
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run demo_nodes_cpp listener
fi

Loading