-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
53 lines (39 loc) · 1.28 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
FROM ros:humble-ros-base
ENV DEBIAN_FRONTEND=noninteractive
ARG USERNAME=rr-user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN apt-get update \
&& apt-get install -y \
clang \
clang-tidy \
clang-format \
gdb \
python3-pip \
wget \
vim
RUN pip3 install black
RUN wget https://code.visualstudio.com/sha/download\?build\=stable\&os\=linux-deb-x64 -O code.deb
RUN apt-get install -y ./code.deb
# Setup User
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME\
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
USER $USERNAME
# Validate setup
RUN mkdir -p /home/$USERNAME/ws/src
WORKDIR /home/$USERNAME/ws
COPY .vscode .vscode
COPY *_extensions.txt .
COPY .env .
# Install extensions
RUN cat general_extensions.txt | xargs -I {} code --install-extension {} \
&& cat cpp_extensions.txt | xargs -I {} code --install-extension {} \
&& cat python_extensions.txt | xargs -I {} code --install-extension {}
# Clean up apt cache
RUN sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*