-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlaybackNetworkShare.txt
57 lines (39 loc) · 1.64 KB
/
PlaybackNetworkShare.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Simple example: How to run two docker containers that will share a network connection for Ros.
1. Create the local network from docker
docker network create localros
2. Start up your docker container, with the name set for easy reuse later
docker run -it --rm --net localros --name master rosblank roscore
3. start up the other container, which should have access to the ros master effectively
docker run -it --rm --net localros --name test1 --env ROS_HOSTNAME=test1 --env ROS_MASTER_URI=http://master:11311 rosblank /bin/bash
Note: this used the below Dockerfile, creating an image called "rosblank"
```
FROM ros:noetic-robot
# change the default shell command
SHELL ["/bin/bash", "-c"]
#ENV TERM linux
ENV TERM xterm-256color
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y wget
#RUN apt-get install -y curl nano iputils-ping net-tools git cmake build-essential
#RUN apt-get update
#RUN apt-get install -y ros-noetic-tf2 ros-noetic-tf ros-noetic-geodesy python3-catkin-pkg
#
#
#RUN mkdir -p home/catkin_ws/src
#RUN cd home/catkin_ws/src/ && git clone https://github.com/jmscslgroup/ros2ascii
#RUN /bin/bash -c '. /opt/ros/noetic/setup.bash; cd home/catkin_ws; catkin_make'
#
##RUN "source /home/catkin_ws/devel/setup.bash"
#RUN echo "source /home/catkin_ws/devel/setup.bash" >> /root/.bashrc
# this gets run in this image
RUN source ros_entrypoint.sh
# now add this to all future calls
RUN echo "source /ros_entrypoint.sh" >> /etc/bash.bashrc
CMD ["/bin/bash"]
# RUN export ROS_MASTER_URI="http://$(hostname):11311"
# RUN export ROS_HOSTNAME="$(hostname)"
#ADD start.sh /
#RUN chmod u+x start.sh
#CMD ["/start.sh"]
```