-
Notifications
You must be signed in to change notification settings - Fork 86
/
Dockerfile.build
53 lines (48 loc) · 2.02 KB
/
Dockerfile.build
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
ARG CUDA_VERSION=9.1
FROM nvidia/cuda:${CUDA_VERSION}-devel-ubuntu16.04
ARG FFMPEG_VERSION=3.4.2
ARG CMAKE_VERSION=3.10.2
# nvcuvid deps
RUN apt-get update --fix-missing && \
apt-get install -y libx11-6 libxext6
ENV NVIDIA_DRIVER_CAPABILITIES=video,compute,utility
# minimal ffmpeg from source
RUN apt-get install -y yasm wget && \
cd /tmp && wget -q http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
tar xf ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
rm ffmpeg-$FFMPEG_VERSION.tar.bz2 && \
cd ffmpeg-$FFMPEG_VERSION && \
./configure \
--prefix=/usr/local \
--disable-static \
--disable-all \
--disable-autodetect \
--disable-iconv \
--enable-shared \
--enable-avformat \
--enable-avcodec \
--enable-avfilter \
--enable-protocol=file \
--enable-demuxer=mov,matroska \
--enable-bsf=h264_mp4toannexb,hevc_mp4toannexb && \
make -j8 && make install && \
cd /tmp && rm -rf ffmpeg-$FFMPEG_VERSION && \
apt-get purge -y yasm wget && \
apt-get autoremove -y
# video_reader build deps (pkg-config, Doxygen, recent cmake)
RUN apt-get install -y pkg-config doxygen wget && \
cd /tmp && \
export dir=$(echo $CMAKE_VERSION | sed "s/^\([0-9]*\.[0-9]*\).*/v\1/") && \
wget -q https://cmake.org/files/${dir}/cmake-$CMAKE_VERSION-Linux-x86_64.sh && \
/bin/sh cmake-$CMAKE_VERSION-Linux-x86_64.sh --skip-license --prefix=/usr/local && \
rm cmake-$CMAKE_VERSION-Linux-x86_64.sh && \
apt-get purge -y wget && \
apt-get autoremove -y
# nvidia-docker only provides libraries for runtime use, not for
# development, to hack it so we can develop inside a container (not a
# normal or supported practice), we need to make an unversioned
# symlink so gcc can find the library. Additional, different
# nvidia-docker versions put the lib in different places, so we make
# symlinks for both places.
RUN ln -s /usr/local/nvidia/lib64/libnvcuvid.so.1 /usr/local/lib/libnvcuvid.so && \
ln -s libnvcuvid.so.1 /usr/lib/x86_64-linux-gnu/libnvcuvid.so