Skip to content

Commit 1bb9d27

Browse files
committed
fix example 1
1 parent c0ab873 commit 1bb9d27

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ ros2 launch my_turtle_bringup turtlesim_demo.launch.py
6262
**Please stay in `ros2_docker_examples/` directory while executing those commands:**
6363

6464
```
65-
sudo chmod +x eg1/init-container.sh
6665
sudo chmod +x eg1/ros_entrypoint.sh
6766
6867
docker build -t turtle_demo -f eg1/Dockerfile .
6968
7069
xhost local:root
7170
72-
docker run --rm -it \
71+
sudo docker run --rm -it \
7372
--env DISPLAY \
7473
--volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
75-
turtle_demo
74+
turtle_demo \
75+
ros2 launch my_turtle_bringup turtlesim_demo.launch.py
7676
```
7777

7878
## [Eg. 2] Running in two containers (using `docker-compose`)

eg1/Dockerfile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,12 @@ FROM osrf/ros:foxy-desktop
22

33
SHELL ["/bin/bash", "-c"]
44

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-
105
COPY ros2_ws ros2_ws/
116
RUN cd ros2_ws && \
127
source /opt/ros/foxy/setup.bash && \
138
colcon build
149

1510
COPY eg1/ros_entrypoint.sh /
16-
COPY eg1/init-container.sh /opt
17-
18-
USER user1
1911

2012
ENTRYPOINT ["/ros_entrypoint.sh"]
21-
CMD /opt/init-container.sh
13+
CMD ["bash"]

eg1/init-container.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

eg1/ros_entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
set -e
33

44
source /opt/ros/foxy/setup.bash
5-
source /home/user1/ros2_ws/install/setup.bash
5+
source /ros2_ws/install/setup.bash
66

77
exec "$@"

0 commit comments

Comments
 (0)