-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
46 lines (37 loc) · 1.43 KB
/
Dockerfile.dev
File metadata and controls
46 lines (37 loc) · 1.43 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
# syntax=docker/dockerfile:1.7-labs
FROM ros:humble
SHELL ["/bin/bash", "-c"]
# Set up CEV user
RUN useradd -m -s /bin/bash cev
RUN usermod -aG sudo cev
# Grant passwordless sudo access to the 'sudo' group
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER cev
ARG FOLDER_NAME=rc-brain
ARG WORKSPACE_DIR=/home/cev
WORKDIR $WORKSPACE_DIR
# Docker doesn't do this by default
RUN sudo chown -R cev /home/cev
# Source the ROS2 environment automatically when a new shell is created
RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc
RUN echo "source $WORKSPACE_DIR/install/setup.bash" >> ~/.bashrc
# Install dev tools
RUN sudo apt-get update
# Tools required to run clang install
RUN sudo apt-get install -y \
curl \
lsb-release \
software-properties-common \
gnupg
RUN curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- 19
RUN sudo apt-get install -y clangd-19
RUN sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-19 100
# Init rosdep and update package index
RUN rosdep update --rosdistro $ROS_DISTRO
# Run install_extra.sh, which installs additional dependencies
COPY --chown=cev scripts/install_extra.sh src/$FOLDER_NAME/scripts/
RUN sudo src/$FOLDER_NAME/scripts/install_extra.sh
# Install own dependencies
RUN mkdir -p src/$FOLDER_NAME
COPY --chown=cev --parents **/package.xml src/$FOLDER_NAME/
RUN source /opt/ros/$ROS_DISTRO/setup.bash && rosdep install --from-paths src -r -y