1
0
intel-media-ffmpeg/Dockerfile
James Ketrenos a6ac009cc0 Auto-update to Agama-192
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
2019-10-04 10:08:01 -07:00

210 lines
6.5 KiB
Docker

#
# DO NOT EDIT THIS DOCKERFILE
#
# This file is auto-generated via scripts/build-dockerfile
# by using environment substitution while concatenating the
# contents of templates/*, and then adding the contents
# of Dockerfile.solution
#
# Most solution specific changes should be isolated in
# Dockerfile.solution. After making changes, you can
# then re-run scripts/build-dockerfile
#
#
# Template from templates/templates/00-FROM.in
#
# Pull from the internal cache of images
FROM amr-registry.caas.intel.com/vtt-osgc/os/ubuntu:disco AS base
#
# Template from templates/templates/05-intel-proxy.in
#
# Pre-install proxy configuration values
#
# This uses the linux-ftp.ostc.intel.com as a mirror.
RUN echo "Acquire::http::proxy \"http://proxy-chain.intel.com:911/\";\n" \
"Acquire::https::proxy \"https://proxy-chain.intel.com:911/\";\n" \
"Acquire::ftp::proxy \"ftp://proxy-chain.intel.com:911/\";\n" \
"Acquire::socks::proxy \"socks://proxy-chain.intel.com:1080/\";\n" \
"Acquire::http::Proxy::linux-ftp.ostc.intel.com DIRECT;\n" \
"Acquire::http::Proxy::osgc.jf.intel.com DIRECT;\n" > /etc/apt/apt.conf
#
# Template from templates/templates/08-intel-certs.in
#
# Install Intel CA5A cert so Intel certs are recognized
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
ca-certificates \
wget \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} \
&& mkdir -p /usr/local/share/ca-certificates \
&& wget -qO tmp.zip http://certificates.intel.com/repository/certificates/IntelSHA2RootChain-Base64.zip \
&& unzip tmp.zip -d /usr/local/share/ca-certificates \
&& rm tmp.zip \
&& wget -qO tmp.zip http://certificates.intel.com/repository/certificates/Intel%20Root%20Certificate%20Chain%20Base64.zip \
&& unzip tmp.zip -d /usr/local/share/ca-certificates \
&& rm tmp.zip \
&& apt-get remove -y wget unzip \
&& update-ca-certificates --fresh
#
# Template from templates/templates/10-default-packages.in
#
# Update the repo lists and then install things using the internal
# sources. Packages used by many developers are pulled into this image
# but we do want it to be relatively small.
#
# NOTE: We use DEBIAN_FRONTEND=noninteractive to prevent krb5-user from
# trying to prompt for configuration details during install.
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends -q \
locales \
software-properties-common
# Set up locales
RUN localedef -c -f UTF-8 -i en_US en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
#
# Template from templates/templates/20-agama-packages.in
#
FROM base AS agama
# Update and install gpg-agent as it isn't in the base Ubuntu image and is needed for apt-key
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \
wget \
gpg-agent \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
# Fetch and install the signing key for OSGC's Agama repository
RUN wget --no-proxy --quiet -O /tmp/aptly.key http://osgc.jf.intel.com/packages/agama/ubuntu/aptly_repo_signing.key \
&& APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn apt-key add /tmp/aptly.key \
&& rm /tmp/aptly.key
# Add internal Agama repository
RUN apt-add-repository "deb [arch=amd64] http://osgc.jf.intel.com/packages/agama/ubuntu disco main"
RUN apt-get remove -y wget
#
# Template from templates/templates/25-agama-user.in
#
# Create user 'agama' and add them to 'sudo' for sudo access and set
# the passwd to 'agama'
FROM agama AS agama-user
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
sudo \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
# NOTE: Requires 'sudo' package to already be installed
RUN groupadd -r agama \
&& useradd --no-log-init \
-s /bin/bash \
-r -m \
-g agama \
-G sudo \
-p $(echo "agama" | openssl passwd -stdin) agama
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
#
# Solution begins here (from Dockerfile.solution)
#
#
# Docker.solution based on the Intel-Media-SDK instructions available here:
#
# https://github.com/Intel-Media-SDK/MediaSDK/wiki/Build-and-use-ffmpeg-with-MediaSDK
#
# This should really be part of a multi-stage build so the final
# image isn't polluted with build artifacts
#
# NOTE: This image will only work with Ubuntu 19.04 (disco) and newer
FROM agama-user AS solution-build
# Install git and build tools, clone ffmpeg, and get ready to build it
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
git build-essential pkg-config
# Clone ffmpeg
# NOTE: This explicitly clones the FFMPEG_TAG_VERSION (see SOLUTIONS)
RUN git clone --depth 1 --branch n4.2.1 https://github.com/ffmpeg/ffmpeg /home/agama/ffmpeg
# Install all required common packages:
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
libva-dev=2.6.0.agama-192 \
libmfx-dev=19.2.pre3.agama-192 \
libmfx1=19.2.pre3.agama-192 \
vainfo=2.6.0.agama-192 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LIBVA_DRIVER_NAME=iHD
# Build FFmpeg
WORKDIR /home/agama/ffmpeg
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make -j $(nproc --all) \
&& make install
FROM agama-user
ENV LIBVA_DRIVER_NAME=iHD
# Update and install the Mesa, OpenCL, and Media from Agama
#
# NOTE: libva requires libpciaccess0, however it doesn't depend on it
# so explicitly install it.
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \
intel-media-va-driver-non-free=19.3.pre4.agama-192 \
libigdgmm11=19.3.2.agama-192 \
libva2=2.6.0.agama-192 \
libmfx1=19.2.pre3.agama-192 \
vainfo=2.6.0.agama-192 \
libpciaccess0 \
pciutils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY assets/ /assets/
# Copy ffmpeg and ffprobe from build container
COPY --from=solution-build /usr/local/bin/ /usr/local/bin/
WORKDIR /home/agama
ENTRYPOINT [ "/assets/entry" ]
#
# Standard ending begins here (from templates/ending.in)
#
# NOTE: This should be added as the last template entry
# as it will always modify a layer (since the Dockerfile
# changes,) causing all subsequent layers to be
# regenerated.
# Ensure that each Docker container self-documents the
# versions included in it
ENV AGAMA_VERSION=192
COPY MANIFEST SOLUTION Dockerfile /assets/