-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.rviz
76 lines (67 loc) · 2.37 KB
/
Dockerfile.rviz
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
FROM ubuntu:22.04
ARG UID=1000
ARG GID=1000
# add new sudo user
ENV USERNAME=humble
ENV HOME=/home/$USERNAME
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \
usermod --shell /bin/bash $USERNAME && \
usermod -aG sudo $USERNAME && \
mkdir /etc/sudoers.d && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
usermod --uid $UID $USERNAME && \
groupmod --gid $GID $USERNAME
# install package
RUN echo "Acquire::GzipIndexes \"false\"; Acquire::CompressionTypes::Order:: \"gz\";" > /etc/apt/apt.conf.d/docker-gzip-indexes
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
sudo \
less \
emacs \
tmux \
bash-completion \
command-not-found \
software-properties-common \
curl \
wget \
coreutils \
build-essential \
pkg-config \
git \
xdg-user-dirs \
libgl1-mesa-dev \
freeglut3-dev \
mesa-utils \
vulkan-tools \
libvulkan-dev \
libglfw3-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install ROS2 Humble
RUN 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
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-humble-desktop-full \
ros-dev-tools \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install colcon and rosdep
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-colcon-common-extensions \
python3-rosdep \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER $USERNAME
WORKDIR /home/$USERNAME
SHELL ["/bin/bash", "-l", "-c"]
# initialize rosdep
RUN sudo rosdep init && \
rosdep update
RUN echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc && \
echo "source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash" >> ~/.bashrc
RUN sudo rm /etc/apt/apt.conf.d/docker-clean