Browse Source

speed up builds by using base images (#398)

pull/399/head
Jason Dove 4 years ago committed by GitHub
parent
commit
4b7da4e468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      docker/nvidia/Dockerfile
  2. 7
      docker/nvidia/ffmpeg.Dockerfile
  3. 44
      docker/vaapi/Dockerfile
  4. 39
      docker/vaapi/ffmpeg.Dockerfile

10
docker/nvidia/Dockerfile

@ -1,10 +1,4 @@ @@ -1,10 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0-focal-amd64 AS dotnet-runtime
FROM jrottenberg/ffmpeg:4.3-nvidia1804 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev tzdata
# https://hub.docker.com/_/microsoft-dotnet
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
RUN apt-get update && apt-get install -y ca-certificates
WORKDIR /source
@ -29,7 +23,7 @@ ARG INFO_VERSION="unknown" @@ -29,7 +23,7 @@ ARG INFO_VERSION="unknown"
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore /p:InformationalVersion=${INFO_VERSION}
# final stage/image
FROM runtime-base
FROM jasongdove/ffmpeg:4.3-nvidia1804 AS runtime-base
WORKDIR /app
EXPOSE 8409
COPY --from=build /app ./

7
docker/nvidia/ffmpeg.Dockerfile

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0-focal-amd64 AS dotnet-runtime
FROM jrottenberg/ffmpeg:4.3-nvidia1804 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update \
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev tzdata \
&& rm -rf /var/lib/apt/lists/*

44
docker/vaapi/Dockerfile

@ -1,44 +1,4 @@ @@ -1,44 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0-focal-amd64 AS dotnet-runtime
FROM jrottenberg/ffmpeg:4.3-vaapi2004 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev \
tzdata \
autoconf \
libtool \
libdrm-dev \
git \
pkg-config \
build-essential \
cmake \
wget \
&& mkdir /tmp/intel && cd /tmp/intel \
&& wget -O - https://github.com/intel/libva/archive/refs/tags/2.12.0.tar.gz | tar zxf - \
&& cd libva-2.12.0 \
&& ./autogen.sh \
&& ./configure \
&& make -j$(nproc) \
&& make -j$(nproc) install \
&& cd /tmp/intel \
&& wget -O - https://github.com/intel/gmmlib/archive/refs/tags/intel-gmmlib-21.3.1.tar.gz | tar zxf - \
&& mv gmmlib-intel-gmmlib-21.3.1 gmmlib \
&& cd gmmlib \
&& mkdir build && cd build \
&& cmake .. \
&& make -j$(nproc) \
&& cd /tmp/intel \
&& git clone https://github.com/intel/media-driver && cd media-driver && git checkout intel-media-21.2.3 && cd .. \
&& mkdir build_media && cd build_media \
&& cmake ../media-driver \
&& make -j$(nproc) \
&& make install \
&& DEBIAN_FRONTEND="noninteractive" apt-get purge -y autoconf libtool git build-essential cmake wget \
&& apt autoremove -y \
&& rm -rf /tmp/intel \
&& rm -rf /var/lib/apt/lists/* \
&& mv /usr/lib/x86_64-linux-gnu/dri/i* /usr/local/lib/dri/
# https://hub.docker.com/_/microsoft-dotnet
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
RUN apt-get update && apt-get install -y ca-certificates
WORKDIR /source
@ -63,7 +23,7 @@ ARG INFO_VERSION="unknown" @@ -63,7 +23,7 @@ ARG INFO_VERSION="unknown"
RUN dotnet publish -c release -o /app -r linux-x64 --self-contained false --no-restore /p:InformationalVersion=${INFO_VERSION}
# final stage/image
FROM runtime-base
FROM jasongdove/ffmpeg:4.3-vaapi2004 AS runtime-base
WORKDIR /app
EXPOSE 8409
COPY --from=build /app ./

39
docker/vaapi/ffmpeg.Dockerfile

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
FROM mcr.microsoft.com/dotnet/aspnet:5.0-focal-amd64 AS dotnet-runtime
FROM jrottenberg/ffmpeg:4.3-vaapi2004 AS runtime-base
COPY --from=dotnet-runtime /usr/share/dotnet /usr/share/dotnet
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y libicu-dev \
tzdata \
autoconf \
libtool \
libdrm-dev \
git \
pkg-config \
build-essential \
cmake \
wget \
&& mkdir /tmp/intel && cd /tmp/intel \
&& wget -O - https://github.com/intel/libva/archive/refs/tags/2.12.0.tar.gz | tar zxf - \
&& cd libva-2.12.0 \
&& ./autogen.sh \
&& ./configure \
&& make -j$(nproc) \
&& make -j$(nproc) install \
&& cd /tmp/intel \
&& wget -O - https://github.com/intel/gmmlib/archive/refs/tags/intel-gmmlib-21.3.1.tar.gz | tar zxf - \
&& mv gmmlib-intel-gmmlib-21.3.1 gmmlib \
&& cd gmmlib \
&& mkdir build && cd build \
&& cmake .. \
&& make -j$(nproc) \
&& cd /tmp/intel \
&& git clone --depth 1 --branch intel-media-21.2.3 https://github.com/intel/media-driver \
&& mkdir build_media && cd build_media \
&& cmake ../media-driver \
&& make -j$(nproc) \
&& make install \
&& DEBIAN_FRONTEND="noninteractive" apt-get purge -y autoconf libtool git build-essential cmake wget \
&& apt autoremove -y \
&& rm -rf /tmp/intel \
&& rm -rf /var/lib/apt/lists/* \
&& mv /usr/lib/x86_64-linux-gnu/dri/i* /usr/local/lib/dri/
Loading…
Cancel
Save