-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile.jetson-tx2
84 lines (60 loc) · 2.81 KB
/
Dockerfile.jetson-tx2
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
FROM balenalib/jetson-tx2-ubuntu:bionic-run-20221215
WORKDIR /usr/src/app
#OpenDataCam 3.0.2
ENV DEBIAN_FRONTEND noninteractive
# Install some utils
RUN apt-get update && apt-get install -y lbzip2 git wget unzip jq
# Update to 32.7 repository in case the base image is using 32.6
RUN sed -i 's/r32.6 main/r32.7 main/g' /etc/apt/sources.list.d/nvidia.list
# Install CUDA/cuDNN
RUN apt-get install -y nvidia-l4t-cuda nvidia-cuda libcudnn8 libcudnn8-dev
# Set paths
ENV CUDA_HOME=/usr/local/cuda-10.2
# Download and install BSP binaries for L4T 32.4.2
RUN apt-get update && apt-get install -y wget tar lbzip2 python3 libegl1 binutils && \
cd /tmp/ && wget https://developer.nvidia.com/embedded/l4t/r32_release_v7.2/t186/jetson_linux_r32.7.2_aarch64.tbz2 && \
tar xf jetson_linux_r32.7.2_aarch64.tbz2 && rm jetson_linux_r32.7.2_aarch64.tbz2&& \
cd Linux_for_Tegra && \
sed -i 's/config.tbz2\"/config.tbz2\" --exclude=etc\/hosts --exclude=etc\/hostname/g' apply_binaries.sh && \
sed -i 's/install --owner=root --group=root \"${QEMU_BIN}\" \"${L4T_ROOTFS_DIR}\/usr\/bin\/\"/#install --owner=root --group=root \"${QEMU_BIN}\" \"${L4T_ROOTFS_DIR}\/usr\/bin\/\"/g' nv_tegra/nv-apply-debs.sh && \
sed -i 's/chroot . \// /g' nv_tegra/nv-apply-debs.sh && \
./apply_binaries.sh -r / --target-overlay && cd .. \
rm -rf Linux_for_Tegra && \
echo "/usr/lib/aarch64-linux-gnu/tegra" > /etc/ld.so.conf.d/nvidia-tegra.conf && ldconfig
# install some OpenCV prerequesets
RUN \
apt-get install -y libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev libwebp-dev libtbb2 libtbb-dev libgstreamer1.0-0 \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good cmake pkg-config
# Copy/expand prebuilt OpenCV 4.1.1
COPY opencv411_include.tar.gz .
COPY opencv411_lib.tar.gz .
RUN tar -xvf opencv411_lib.tar.gz -C /usr/local && tar -xvf opencv411_include.tar.gz -C /usr/local/include
# Copy cuDNN files for Darkent
RUN \
cp /usr/include/cudnn.h /usr/local/cuda-10.2/include && \
cp -P /usr/lib/aarch64-linux-gnu/libcudnn* /usr/local/cuda-10.2/lib64
WORKDIR /
# Download and build Darknet
RUN \
git clone https://github.com/AlexeyAB/darknet.git
WORKDIR /darknet
COPY ./Makefile.jetson-tx2 ./Makefile
RUN make && ldconfig
#get weights
RUN wget https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v4_pre/yolov4-tiny.weights --no-check-certificate > /dev/null 2>&1
# Download and install OpenDataCam
# first install node.js
RUN \
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get install -y nodejs
RUN \
git clone --depth 1 https://github.com/opendatacam/opendatacam.git /var/local/opendatacam
WORKDIR /var/local/opendatacam
RUN \
npm install && \
npm run build
EXPOSE 8080 8070 8090
COPY config.jetson-tx2 config.bak
COPY launch.sh launch.sh
RUN chmod 777 launch.sh
CMD ["./launch.sh"]