-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
94 lines (77 loc) · 2.63 KB
/
Dockerfile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM ubuntu:22.04
# Set the locale
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && \
apt-get install -q -y tzdata && \
rm -rf /var/lib/apt/lists/*
# Install required packages
RUN apt-get update && apt-get install -y \
software-properties-common \
lsb-release \
sudo \
gnupg2 \
curl \
git \
wget \
openssh-server \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
# Set up sources for ROS 2 Humble
RUN apt-get update && apt-get install -y \
locales \
&& locale-gen en_US en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \
&& export LANG=en_US.UTF-8 \
&& apt-get update && apt-get install -y \
curl \
gnupg2 \
&& curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null
# Install ROS 2 Humble and Gazebo - will install the dependencies so chill for half an hour
RUN apt-get update && apt-get install -y \
ros-humble-desktop \
ros-humble-gazebo-ros-pkgs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Colcon dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
python3-apt \
python3-rosdep \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/*
# Install Colcon using pip
RUN python3 -m pip install -U colcon-common-extensions
# Source the ROS 2 setup script
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc
# Create a workspace directory
RUN mkdir -p /ros2_ws/src
# installing OMPL
# Copy the install script
COPY gazebo_ros/OMPL/install-ompl-ubuntu.sh /
# Give elevated permissions
RUN chmod +x /install-ompl-ubuntu.sh
# Run the install script
RUN /install-ompl-ubuntu.sh
# Set the volume for persistence
VOLUME /ros2_ws/src
# Copy the entrypoint script
COPY entrypoint.sh /
# Make the entrypoint script executable
RUN chmod +x /entrypoint.sh
#exposing the port
RUN mkdir /var/run/sshd \
&& echo 'root:password' | chpasswd \
&& sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config \
&& ssh-keygen -A
# Expose SSH port
EXPOSE 22
# Set the entrypoint script as the command to run
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bash"]