-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
75 lines (67 loc) · 2.52 KB
/
Dockerfile
File metadata and controls
75 lines (67 loc) · 2.52 KB
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
# Base image
FROM ubuntu:24.04
ENV ROS_DISTRO=jazzy
ENV DEBIAN_FRONTEND=noninteractive
# Create a non-root user
ARG USERNAME=devol-dev
ARG USER_UID
ARG USER_GID
# Install dependencies
RUN apt-get update && apt-get install -y \
sudo \
build-essential \
cmake \
wget \
git \
curl \
openssh-client \
openssh-server \
xauth \
sshpass \
unzip \
ca-certificates \
gdb \
wget \
python3 \
python3-venv \
python3-pip \
python3-setuptools \
software-properties-common \
&& add-apt-repository universe \
&& 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 $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null \
&& apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y ros-dev-tools ros-${ROS_DISTRO}-desktop \
# Ros2 control libraries
ros-${ROS_DISTRO}-ros2-control ros-${ROS_DISTRO}-ros2-controllers ros-${ROS_DISTRO}-teleop-twist-keyboard \
# MoveIt Libraries
ros-${ROS_DISTRO}-moveit \
# Universal Robots Library
ros-${ROS_DISTRO}-ur \
# Gazebo Libraries
ros-${ROS_DISTRO}-ros-gz ros-${ROS_DISTRO}-gz-ros2-control \
# Robotiq Libraries
ros-${ROS_DISTRO}-robotiq-description ros-${ROS_DISTRO}-robotiq-controllers \
# Camera libraries
ros-${ROS_DISTRO}-vision-msgs ros-${ROS_DISTRO}-moveit-ros-perception \
ros-${ROS_DISTRO}-librealsense2* ros-${ROS_DISTRO}-realsense2* \
# Dynamixel libary
ros-${ROS_DISTRO}-dynamixel-workbench-toolbox \
# Python libraries
ros-${ROS_DISTRO}-moveit-py \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --gid ${USER_GID} ${USERNAME} \
&& useradd -ms /bin/bash --uid ${USER_UID} --gid ${USER_GID} -G sudo ${USERNAME} \
&& echo "${USERNAME}:${USERNAME}" | chpasswd
# Switch to the non-root user
USER ${USERNAME}
# Upgrade pip and install Python dependencies
RUN python3 -m venv /home/${USERNAME}/.devol_venv \
&& . /home/${USERNAME}/.devol_venv/bin/activate \
&& pip install --upgrade pip setuptools numpy matplotlib scipy \
&& pip install --upgrade colcon-common-extensions \
&& . /opt/ros/${ROS_DISTRO}/setup.sh
ENV PATH=/home/${USERNAME}/.devol_venv/bin:/home/${USERNAME}/.local/bin:$PATH
COPY --chown=${USERNAME}:${USERNAME} .bashrc /home/${USERNAME}/.bashrc