File tree Expand file tree Collapse file tree 4 files changed +5
-18
lines changed Expand file tree Collapse file tree 4 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -62,17 +62,17 @@ ros2 launch my_turtle_bringup turtlesim_demo.launch.py
62
62
** Please stay in ` ros2_docker_examples/ ` directory while executing those commands:**
63
63
64
64
```
65
- sudo chmod +x eg1/init-container.sh
66
65
sudo chmod +x eg1/ros_entrypoint.sh
67
66
68
67
docker build -t turtle_demo -f eg1/Dockerfile .
69
68
70
69
xhost local:root
71
70
72
- docker run --rm -it \
71
+ sudo docker run --rm -it \
73
72
--env DISPLAY \
74
73
--volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
75
- turtle_demo
74
+ turtle_demo \
75
+ ros2 launch my_turtle_bringup turtlesim_demo.launch.py
76
76
```
77
77
78
78
## [ Eg. 2] Running in two containers (using ` docker-compose ` )
Original file line number Diff line number Diff line change @@ -2,20 +2,12 @@ FROM osrf/ros:foxy-desktop
2
2
3
3
SHELL ["/bin/bash" , "-c" ]
4
4
5
- # Create a new user "user1"
6
- RUN useradd -ms /bin/bash user1 && usermod -aG sudo user1 && echo 'user1 ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
7
-
8
- WORKDIR /home/user1
9
-
10
5
COPY ros2_ws ros2_ws/
11
6
RUN cd ros2_ws && \
12
7
source /opt/ros/foxy/setup.bash && \
13
8
colcon build
14
9
15
10
COPY eg1/ros_entrypoint.sh /
16
- COPY eg1/init-container.sh /opt
17
-
18
- USER user1
19
11
20
12
ENTRYPOINT ["/ros_entrypoint.sh" ]
21
- CMD /opt/init-container.sh
13
+ CMD [ "bash" ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
set -e
3
3
4
4
source /opt/ros/foxy/setup.bash
5
- source /home/user1/ ros2_ws/install/setup.bash
5
+ source /ros2_ws/install/setup.bash
6
6
7
7
exec " $@ "
You can’t perform that action at this time.
0 commit comments