Commit a07b2299 authored by levi's avatar levi
Browse files

more docker

parent cc056ecb
ARG FROM_IMAGE=ros:foxy
ARG FROM_IMAGE=osrf/ros:foxy-desktop
ARG OVERLAY_WS=/opt/ros/overlay_ws
# multi-stage for caching
......@@ -47,4 +47,4 @@ RUN sed --in-place --expression \
/ros_entrypoint.sh
# run launch file
CMD ["ros2", "launch", "rmq_bridge", "rmq_bridge_docker.launch.py"]
\ No newline at end of file
CMD ["ros2", "launch", "rmq_bridge", "rmq_publisher_docker.launch.py"]
\ No newline at end of file
version: '3'
services:
rmq-server:
container_name: drobotti-rmq-server
build:
context: ./../../
dockerfile: ./docker/rmq-server/rmq_server.Dockerfile
restart: unless-stopped
network_mode: "host"
# ports:
# - 5672:5672
# - 15672:15672
# - 1883:1883
rmq-bridge:
container_name: drobotti-rmq-bridge
build:
context: ./../../
dockerfile: ./docker/rmq-bridge/rmq_bridge.Dockerfile
restart: unless-stopped
network_mode: "host"
# ports:
# - 5672:5672
# - 1883:1883
# links:
# - rmq-server
\ No newline at end of file
ARG FROM_IMAGE=osrf/ros:foxy-desktop
ARG OVERLAY_WS=/opt/ros/overlay_ws
# multi-stage for caching
FROM $FROM_IMAGE AS cacher
# copy overlay source
ARG OVERLAY_WS
WORKDIR $OVERLAY_WS/src
COPY src/ ./
# copy manifests for caching
WORKDIR /opt
RUN mkdir -p /tmp/opt && \
find ./ -name "package.xml" | \
xargs cp --parents -t /tmp/opt && \
find ./ -name "COLCON_IGNORE" | \
xargs cp --parents -t /tmp/opt || true
# multi-stage for building
FROM $FROM_IMAGE AS builder
# install overlay dependencies
ARG OVERLAY_WS
WORKDIR $OVERLAY_WS
COPY --from=cacher /tmp/$OVERLAY_WS/src ./src
RUN . /opt/ros/$ROS_DISTRO/setup.sh
RUN apt-get update && rosdep install -y \
--from-paths src/ \
--ignore-src \
&& rm -rf /var/lib/apt/lists/*
# build overlay source
COPY --from=cacher $OVERLAY_WS/src ./src
ARG OVERLAY_MIXINS="release"
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \
colcon build \
--packages-select \
rmq_bridge \
--mixin $OVERLAY_MIXINS
# source entrypoint setup
ENV OVERLAY_WS $OVERLAY_WS
RUN sed --in-place --expression \
'$isource "$OVERLAY_WS/install/setup.bash"' \
/ros_entrypoint.sh
# run launch file
CMD ["ros2", "launch", "rmq_bridge", "rmq_subscriber_docker.launch.py"]
\ No newline at end of file
ARG FROM_IMAGE=osrf/ros:foxy-desktop
ARG OVERLAY_WS=/opt/ros/overlay_ws
FROM $FROM_IMAGE AS cacher
WORKDIR /opt
RUN . /opt/ros/$ROS_DISTRO/setup.sh
# run launch file
CMD ["ros2", "multicast","receive"]
\ No newline at end of file
ARG FROM_IMAGE=ros:foxy
ARG FROM_IMAGE=osrf/ros:foxy-desktop
ARG OVERLAY_WS=/opt/ros/overlay_ws
# multi-stage for caching
......
version: '3'
networks:
drobotti:
driver: bridge
# networks:
# drobotti:
# driver: bridge
services:
# ubuntu:
......@@ -10,7 +10,8 @@ services:
# build:
# context: ./ubuntu-network-test
# restart: always
# # network_mode: bridge
# network_mode: bridge
# network_mode: host
# networks:
# - drobotti
rmq_server:
......@@ -19,30 +20,51 @@ services:
context: ../
dockerfile: ./docker/rmq-server/rmq_server.Dockerfile
restart: always
networks:
- drobotti
ports:
- 5672:5672
- 15672:15672
- 1883:1883
teleop_terminal:
container_name: teleop
build:
context: ../
dockerfile: ./docker/teleop-terminal/teleop_terminal.Dockerfile
restart: always
networks:
- drobotti
stdin_open: true # docker run -i
tty: true # docker run -t
rmq_bridge:
container_name: rmq-bridge
network_mode: host
# networks:
# - drobotti
# ports:
# - 5672:5672
# - 15672:15672
# - 1883:1883
# teleop_terminal:
# container_name: teleop
# build:
# context: ../
# dockerfile: ./docker/teleop-terminal/teleop_terminal.Dockerfile
# restart: always
# networks:
# - drobotti
# stdin_open: true # docker run -i
# tty: true # docker run -t
# rmq_publisher:
# container_name: rmq-pub
# build:
# context: ../
# dockerfile: ./docker/rmq-publisher/rmq_publisher.Dockerfile
# depends_on:
# - rmq_server
# # - teleop_terminal
# restart: always
# network_mode: host
# # networks:
# # - drobotti
rmq_subscriber:
container_name: rmq-sub
build:
context: ../
dockerfile: ./docker/rmq-bridge/rmq_bridge.Dockerfile
dockerfile: ./docker/rmq-subscriber/rmq_subscriber.Dockerfile
depends_on:
- rmq_server
- teleop_terminal
# - teleop_terminal
restart: always
network_mode: host
# networks:
# - drobotti
ros2_multicast_receive:
container_name: ros2-multi
build: ./ros2-multicast-test
restart: always
networks:
- drobotti
\ No newline at end of file
network_mode: host
# networks:
# - drobotti
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment