-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
159 lines (143 loc) · 4.88 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
FROM docker.io/arm64v8/ubuntu:24.04
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all
ARG UID=1000
ARG GID=1000
# add new sudo user
ENV USERNAME jetson
ENV HOME /home/$USERNAME
# https://askubuntu.com/questions/1513927/ubuntu-24-04-docker-images-now-includes-user-ubuntu-with-uid-gid-1000
RUN if getent passwd $UID; then \
userdel -f $(getent passwd $UID | cut -d: -f1); \
fi \
&& if getent group $GID; then \
groupdel $(getent group $GID | cut -d: -f1); \
fi
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
RUN gpasswd -a $USERNAME video
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -qq -y --no-install-recommends \
bash-completion \
bc \
build-essential \
bzip2 \
can-utils \
ca-certificates \
cmake \
command-not-found \
curl \
emacs \
freeglut3-dev \
git \
gnupg2 \
gstreamer1.0-alsa \
gstreamer1.0-libav \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
gstreamer1.0-tools \
i2c-tools \
iproute2 \
iputils-ping \
iw \
kbd \
kmod \
language-pack-en-base \
libapt-pkg-dev \
libcanberra-gtk3-module \
libgles2 \
libglu1-mesa-dev \
libglvnd-dev \
libgtk-3-0 \
libudev1 \
libvulkan1 \
libzmq5 \
mesa-utils \
mtd-utils \
parted \
pciutils \
python3 \
python3-numpy \
python3-pexpect \
python3-pip \
sox \
sudo \
tmux \
udev \
vulkan-tools \
wget \
wireless-tools \
wpasupplicant \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# EGL
RUN echo "/usr/lib/aarch64-linux-gnu/tegra" >> /etc/ld.so.conf.d/nvidia-tegra.conf && \
echo "/usr/lib/aarch64-linux-gnu/tegra-egl" >> /etc/ld.so.conf.d/nvidia-tegra.conf
RUN rm -rf /usr/share/glvnd/egl_vendor.d && \
mkdir -p /usr/share/glvnd/egl_vendor.d/ && echo '\
{\
"file_format_version" : "1.0.0",\
"ICD" : {\
"library_path" : "libEGL_nvidia.so.0"\
}\
}' > /usr/share/glvnd/egl_vendor.d/10_nvidia.json
RUN mkdir -p /usr/share/egl/egl_external_platform.d/ && echo '\
{\
"file_format_version" : "1.0.0",\
"ICD" : {\
"library_path" : "libnvidia-egl-wayland.so.1"\
}\
}' > /usr/share/egl/egl_external_platform.d/nvidia_wayland.json
RUN echo "deb https://repo.download.nvidia.com/jetson/common r36.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list && \
echo "deb https://repo.download.nvidia.com/jetson/t234 r36.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list && \
echo "deb https://repo.download.nvidia.com/jetson/ffmpeg r36.4 main" >> /etc/apt/sources.list.d/nvidia-l4t-apt-source.list
RUN wget -O /etc/jetson-ota-public.key https://gitlab.com/nvidia/container-images/l4t-base/-/raw/master/jetson-ota-public.key && \
apt-key add /etc/jetson-ota-public.key
# CUDA, cuDNN
RUN apt-get update && \
apt-get install -qq -y --no-install-recommends \
cuda \
libcudnn9 \
libcudnn9-dev \
libcudnn9-samples \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN ldconfig
# install ROS2 Jazzy
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" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
RUN apt-get update && apt-get install -y --no-install-recommends \
ros-jazzy-desktop \
ros-jazzy-rmw-cyclonedds-cpp \
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"]
RUN echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.bashrc && \
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc
# initialize rosdep
RUN sudo rosdep init && \
rosdep update
RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc