-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 1018 Bytes
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 1018 Bytes
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
FROM osrf/ros:noetic-desktop-full
# 1. Install basics
RUN apt-get update && apt-get install -y \
python3-catkin-tools \
python3-pip \
git \
nano \
vim \
bash-completion \
sudo \
&& rm -rf /var/lib/apt/lists/*
# 2. Install conversion libs
RUN pip3 install rosbags mcap-ros2-support zstandard tqdm
# 3. Create user
ARG USERNAME=dev
ARG USER_UID=1000
ARG USER_GID=1000
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
# 4. Environment setup
RUN echo "source /opt/ros/noetic/setup.bash" >> /home/$USERNAME/.bashrc
RUN echo "source /home/$USERNAME/catkin_ws/devel/setup.bash" >> /home/$USERNAME/.bashrc
# This ensures the script is always available inside the container at a known path.
COPY --chown=$USERNAME:$USERNAME src/ /home/$USERNAME/src/
# 5. Entrypoint
USER $USERNAME
WORKDIR /home/$USERNAME/catkin_ws