-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# ffmpeg - http://ffmpeg.org/download.html | ||
# | ||
# From https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu | ||
# | ||
# https://hub.docker.com/r/jrottenberg/ffmpeg/ | ||
# | ||
# | ||
|
||
FROM nvidia/cudagl:9.2-devel-ubuntu18.04 AS devel-base | ||
|
||
ENV NVIDIA_DRIVER_CAPABILITIES compat32,compute,video | ||
WORKDIR /tmp/workdir | ||
|
||
RUN apt-get -yqq update && \ | ||
apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean -y | ||
|
||
FROM nvidia/cudagl:9.2-runtime-ubuntu18.04 AS runtime-base | ||
|
||
ENV NVIDIA_DRIVER_CAPABILITIES compat32,compute,video | ||
WORKDIR /tmp/workdir | ||
|
||
RUN apt-get -yqq update && \ | ||
apt-get install -yq --no-install-recommends ca-certificates expat libgomp1 libxcb-shape0-dev && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean -y | ||
|
||
|
||
FROM devel-base as build | ||
|
||
ENV NVIDIA_HEADERS_VERSION=8.1.24.9 | ||
ARG PKG_CONFIG_PATH=/opt/ffmpeg/lib/pkgconfig | ||
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/ffmpeg/lib" | ||
ARG PREFIX=/opt/ffmpeg | ||
ARG MAKEFLAGS="-j12" | ||
|
||
ENV %%ENV%% | ||
|
||
RUN buildDeps="autoconf \ | ||
automake \ | ||
cmake \ | ||
curl \ | ||
bzip2 \ | ||
libexpat1-dev \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
gperf \ | ||
libtool \ | ||
make \ | ||
nasm \ | ||
perl \ | ||
pkg-config \ | ||
python \ | ||
libssl-dev \ | ||
yasm \ | ||
zlib1g-dev" && \ | ||
apt-get -yqq update && \ | ||
apt-get install -yq --no-install-recommends ${buildDeps} | ||
|
||
RUN \ | ||
DIR=/tmp/nv-codec-headers && \ | ||
git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git ${DIR} && \ | ||
cd ${DIR} && \ | ||
git checkout n${NVIDIA_HEADERS_VERSION} && \ | ||
sed -i 's@/usr/local@'"$PREFIX"'@' Makefile && \ | ||
make && \ | ||
make install && \ | ||
rm -rf ${DIR} | ||
|
||
%%RUN%% | ||
## cleanup | ||
RUN \ | ||
ldd ${PREFIX}/bin/ffmpeg | grep opt/ffmpeg | cut -d ' ' -f 3 | xargs -i cp {} /usr/local/lib/ && \ | ||
cp ${PREFIX}/bin/* /usr/local/bin/ && \ | ||
cp -r ${PREFIX}/share/ffmpeg /usr/local/share/ && \ | ||
LD_LIBRARY_PATH=/usr/local/lib ffmpeg -buildconf | ||
|
||
|
||
|
||
FROM runtime-base AS release | ||
MAINTAINER Julien Rottenberg <julien@rottenberg.info> | ||
|
||
CMD ["--help"] | ||
ENTRYPOINT ["ffmpeg"] | ||
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib" | ||
|
||
COPY --from=build /usr/local/bin /usr/local/bin/ | ||
COPY --from=build /usr/local/share /usr/local/share/ | ||
COPY --from=build /usr/local/lib /usr/local/lib/ | ||
|
||
# Let's make sure the app built correctly | ||
# Convenient to verify on https://hub.docker.com/r/jrottenberg/ffmpeg/builds/ console output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters