Skip to content

Commit d342a6b

Browse files
committed
update dockerfile and bash script
1 parent ab5c1f5 commit d342a6b

File tree

5 files changed

+28
-259
lines changed

5 files changed

+28
-259
lines changed

DockerFiles/Dockerfile

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
# base image osrf/ros tag humble-desktop-full
31
ARG BASE_IMAGE=osrf/ros
42
ARG BASE_TAG= jazzy-desktop-full
53

@@ -40,14 +38,19 @@ RUN apt-get install -y \
4038
iproute2 \
4139
python3-rosdep \
4240
&& apt-get clean
41+
RUN apt-get install -y \
42+
ros-${DISTRO}-rmw-cyclonedds-cpp \
43+
&& apt-get clean
4344
RUN apt-get install -y curl lsb-release gnupg
4445
RUN curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
4546
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
4647
RUN echo " CURL DONE"
4748

48-
RUN sudo apt-get update
49-
RUN sudo apt-get install -y gz-harmonic
49+
RUN apt-get update
50+
RUN apt-get install -y gz-harmonic
5051
RUN echo "Ignition Installed"
52+
RUN apt-get update
53+
RUN apt-get upgrade -y
5154

5255
# install
5356
# Adapt your desired python version here
@@ -92,13 +95,15 @@ RUN pipx install numpy
9295

9396
# Set up auto-source of workspace for ros user
9497
ARG WORKSPACE=docker_navigation
95-
98+
WORKDIR /home/ros/${WORKSPACE}
99+
RUN sudo usermod -a -G render,avahi,video ${USERNAME}
96100
RUN echo "source /opt/ros/${DISTRO}/setup.bash" >> ~/.bashrc
97101

98102
RUN echo "if [ -f ~/${WORKSPACE}/install/setup.bash ]; then source ~/${WORKSPACE}/install/setup.bash; fi" >> /home/ros/.bashrc
99103
RUN echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ros/humble/lib/" >> ~/.bashrc
100104
RUN sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
101-
# install gazebo ignition
102105

103106

104-
ENTRYPOINT ["/ros_entrypoint.sh"]
107+
ENTRYPOINT ["/ros_entrypoint.sh"]
108+
# RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc
109+
# RUN echo "source /home/ros/ros2_ws/install/setup.bash 2>/dev/null || true" >> ~/.bashrc

DockerFiles/build.bash

-55
This file was deleted.

DockerFiles/run.bash

-38
This file was deleted.

Dockerfile_1

-112
This file was deleted.

compose.yaml

+16-47
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
services:
2-
ros2_shell:
2+
ros2_jammy_sim:
33
build:
4-
dockerfile: Dockerfile_1
5-
context: .
6-
container_name: ros2_jammy_it
7-
# networks:
8-
# - ros2_internal
9-
network_mode: "host"
4+
context: ./docker_simulator/DockerFiles
5+
dockerfile: Dockerfile
6+
args:
7+
- BASE_IMAGE=osrf/ros
8+
- BASE_TAG=jazzy-desktop-full
9+
- DISTRO=jazzy
10+
- IMAGE_NAME=docker_control_simulation
11+
- IMAGE_TAG=0.1
12+
- WORKSPACE=docker_simulation_ws
13+
14+
container_name: ros2_jammy_simulator
15+
networks:
16+
- ros2_internal
17+
# network_mode: "host"
1018
# Interactive shell settings
1119
stdin_open: true
1220
tty: true
@@ -34,7 +42,7 @@ services:
3442
- /tmp/.X11-unix:/tmp/.X11-unix:rw
3543
# - /tmp/.docker.xauth:/tmp/.docker.xauth:rw
3644
- ~/.bash_history:/home/ros/.bash_history
37-
- ./:/home/ros/docker_simulation_ws
45+
- ./docker_simulator:/home/ros/docker_simulation_ws
3846
- /dev/input:/dev/input
3947
- /dev/dri:/dev/dri
4048
- /dev/nvidia0:/dev/nvidia0
@@ -64,46 +72,7 @@ services:
6472
- driver: nvidia
6573
count: all
6674
capabilities: [gpu]
67-
# ros2_joy:
68-
# build:
69-
# dockerfile: Dockerfile_1
70-
# context: .
71-
# container_name: ros2_jammy_joy
72-
# networks:
73-
# - ros2_internal
74-
# # Interactive shell settings
75-
# stdin_open: true
76-
# tty: true
77-
# # Network settings
78-
79-
# # Environment variables
80-
# environment:
81-
# - DISPLAY=${DISPLAY}
82-
# - QT_X11_NO_MITSHM=1
83-
# - XAUTHORITY=/tmp/.docker.xauth
84-
# - ROS_DOMAIN_ID=0
85-
# - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
86-
# # Shell history
87-
# - HISTFILE=/home/ros/.bash_history
88-
# - HISTFILESIZE=10000
89-
# - RCUTILS_COLORIZED_OUTPUT=1
90-
# privileged: true # Fixed spelling and removed duplicate
91-
# volumes:
92-
# - /tmp/.X11-unix:/tmp/.X11-unix:rw
93-
# - /tmp/.docker.xauth:/tmp/.docker.xauth:rw
94-
# - ~/.bash_history:/home/ros/.bash_history
95-
# - /home/punk-opc/Documents/docker_navigation:/home/ros/docker_simulation_ws
96-
# - /dev/input:/dev/input
9775

98-
# # Command to source ROS2 environment and start shell
99-
# command: >
100-
# bash -c "
101-
# source /opt/ros/jazzy/setup.bash &&
102-
# echo 'ROS2 Jazzy environment loaded' &&
103-
# bash
104-
# "
105-
# devices:
106-
# - /dev/dri:/dev/dri
10776
networks:
10877
ros2_internal:
10978
driver: bridge

0 commit comments

Comments
 (0)