From d9c9978fafa0e29669a5fc88ed6a4103cd3085c7 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Wed, 13 Nov 2019 11:51:10 -0800 Subject: [PATCH] Updated to latest xe-solutions base Signed-off-by: James Ketrenos --- Dockerfile | 77 +++++++++++++++++++++++++++++---- Dockerfile.solution | 12 ++--- Dockerfile.solution.rhel-8.0 | 6 +-- MANIFEST | 2 +- SOLUTION | 8 ++-- templates/rhel/00-everything.in | 5 +-- templates/ubuntu/00-FROM.in | 4 +- 7 files changed, 86 insertions(+), 28 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ab87e5..dfa8b9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,8 @@ # # Template from templates/ubuntu/00-FROM.in # -# Pull from the internal cache of images -FROM amr-registry.caas.intel.com/vtt-osgc/os/ubuntu:disco AS base +# Pull from ubuntu on Docker Hub +FROM ubuntu:disco AS base # @@ -111,6 +111,41 @@ RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/u #RUN apt-get remove -y wget +# +# Template from templates/ubuntu/20-repositories-intel-com.in +# +FROM base AS pre-user + +# Once we have a signed repository: +# +# 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 repositories.intel.com +# +#RUN wget --no-proxy --quiet -O /tmp/repositories.key ${PACKAGE_KEYFILE} \ +# && APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn \ +# apt-key add /tmp/repositories.key \ +# && rm /tmp/repositories.key + +# Once the keys are being used, remove 'trusted=yes' from the repo line +# below: + +# Install repository as trusted until we have a signed repository: +RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/ubuntu disco main" > /etc/apt/sources.list.d/intel-graphics.list + +# Cleanup +#RUN apt-get remove -y wget + + # # Template from templates/ubuntu/25-agama-user.in # @@ -137,6 +172,32 @@ RUN groupadd -r agama \ # Set 'sudo' to NOPASSWD for all container users RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers +# +# Template from templates/ubuntu/25-graphics-user.in +# +# Create user 'graphics' and add them to 'sudo' for sudo access and set +# the passwd to 'graphics' + +FROM graphics AS user-stage + +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 graphics \ +&& useradd --no-log-init \ + -s /bin/bash \ + -r -m \ + -g graphics \ + -G sudo \ + -p $(echo "graphics" | openssl passwd -stdin) graphics + +# 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) # @@ -149,7 +210,7 @@ RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers # 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 +FROM user-stage AS solution-build # Install git and build tools, clone ffmpeg, and get ready to build it RUN apt-get update \ @@ -158,7 +219,7 @@ RUN apt-get update \ # 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 +RUN git clone --depth 1 --branch $FFMPEG_TAG_VERSION https://github.com/ffmpeg/ffmpeg /home/graphics/ffmpeg # Install all required common packages: RUN apt-get update \ @@ -173,17 +234,17 @@ RUN apt-get update \ ENV LIBVA_DRIVER_NAME=iHD # Build FFmpeg -WORKDIR /home/agama/ffmpeg +WORKDIR /home/graphics/ffmpeg RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \ && make -j $(nproc --all) \ && make install -FROM agama-user +FROM user-stage ENV LIBVA_DRIVER_NAME=iHD -# Update and install the Mesa, OpenCL, and Media from Agama +# Update and install the Mesa, OpenCL, and Media from repositories.intel.com # # NOTE: libva requires libpciaccess0, however it doesn't depend on it # so explicitly install it. @@ -201,7 +262,7 @@ RUN apt-get -q update \ # Copy ffmpeg and ffprobe from build container COPY --from=solution-build /usr/local/bin/ /usr/local/bin/ -WORKDIR /home/agama +WORKDIR /home/graphics # # Standard ending begins here (from templates/ending.in) diff --git a/Dockerfile.solution b/Dockerfile.solution index ec4da84..f0ed32d 100644 --- a/Dockerfile.solution +++ b/Dockerfile.solution @@ -7,7 +7,7 @@ # 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 +FROM user-stage AS solution-build # Install git and build tools, clone ffmpeg, and get ready to build it RUN apt-get update \ @@ -16,7 +16,7 @@ RUN apt-get update \ # Clone ffmpeg # NOTE: This explicitly clones the FFMPEG_TAG_VERSION (see SOLUTIONS) -RUN git clone --depth 1 --branch $FFMPEG_TAG_VERSION https://github.com/ffmpeg/ffmpeg /home/agama/ffmpeg +RUN git clone --depth 1 --branch $FFMPEG_TAG_VERSION https://github.com/ffmpeg/ffmpeg /home/graphics/ffmpeg # Install all required common packages: RUN apt-get update \ @@ -31,17 +31,17 @@ RUN apt-get update \ ENV LIBVA_DRIVER_NAME=iHD # Build FFmpeg -WORKDIR /home/agama/ffmpeg +WORKDIR /home/graphics/ffmpeg RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \ && make -j $(nproc --all) \ && make install -FROM agama-user +FROM user-stage ENV LIBVA_DRIVER_NAME=iHD -# Update and install the Mesa, OpenCL, and Media from Agama +# Update and install the Mesa, OpenCL, and Media from repositories.intel.com # # NOTE: libva requires libpciaccess0, however it doesn't depend on it # so explicitly install it. @@ -59,4 +59,4 @@ RUN apt-get -q update \ # Copy ffmpeg and ffprobe from build container COPY --from=solution-build /usr/local/bin/ /usr/local/bin/ -WORKDIR /home/agama +WORKDIR /home/graphics diff --git a/Dockerfile.solution.rhel-8.0 b/Dockerfile.solution.rhel-8.0 index 1f1062a..3b8665a 100644 --- a/Dockerfile.solution.rhel-8.0 +++ b/Dockerfile.solution.rhel-8.0 @@ -6,7 +6,7 @@ # 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 +FROM user-stage AS solution-build # Install git and build tools, clone ffmpeg, and get ready to build it RUN dnf groupinstall -y 'Development Tools' @@ -32,11 +32,11 @@ RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \ && make -j $(nproc --all) \ && make install -FROM agama-user +FROM user-stage ENV LIBVA_DRIVER_NAME=iHD -# Update and install the Mesa, OpenCL, and Media from Agama +# Update and install the Mesa, OpenCL, and Media from repositories.intel.com # # NOTE: libva requires libpciaccess0, however it doesn't depend on it # so explicitly install it. diff --git a/MANIFEST b/MANIFEST index b3d2b9d..674626f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1 +1 @@ -AGAMA_VERSION="N/A" +RELEASE_INFO="N/A" diff --git a/SOLUTION b/SOLUTION index ca02e39..4f3a187 100644 --- a/SOLUTION +++ b/SOLUTION @@ -1,11 +1,9 @@ -FFMPEG_TAG_VERSION=n4.2.1 +REGISTRY_URL=${REGISTRY_URL:-amr-registry.caas.intel.com/vtt-osgc/solutions} RELEASE_INFO=${RELEASE_INFO:-N/A} - -REPO_URL=${REPO_URL:-amr-registry.caas.intel.com/vtt-osgc/solutions} -CONTAINER=$(basename ${PWD}) +CONTAINER="intel-media-ffmpeg" OS_DISTRO=${OS_DISTRO:-ubuntu} OS_RELEASE=${OS_RELEASE:-disco} PACKAGE_STREAM=${PACKAGE_STREAM:-${OS_RELEASE}} #PACKAGE_STREAM=${PACKAGE_STREAM:-${OS_RELEASE}-devel} PACKAGE_REPOSITORY=${PACKAGE_REPOSITORY:-https://repositories.intel.com/graphics} -#PACKAGE_KEYFILE=https://repositories.intel.com/graphics/repository.key +#PACKAGE_KEYFILE=${PACKAGE_KEYFILE:-https://repositories.intel.com/graphics/repository.key diff --git a/templates/rhel/00-everything.in b/templates/rhel/00-everything.in index 85d719c..5c32618 100644 --- a/templates/rhel/00-everything.in +++ b/templates/rhel/00-everything.in @@ -1,4 +1,4 @@ -FROM dockerv2-gfx-build.gfx-assets.intel.com/upstream/rhel:8.0.0 AS agama-user +FROM dockerv2-gfx-build.gfx-assets.intel.com/upstream/rhel:8.0.0 AS user-stage # Configure DNF and YUM proxies RUN echo "proxy=http://proxy-chain.intel.com:911" >> /etc/dnf/dnf.conf \ @@ -170,9 +170,8 @@ RUN dnf clean all \ && dnf -y upgrade \ && dnf clean all -# Agama specific content begins here +# repositories.intel.com specific content begins here # -# # Intel certificates which would allow internal signed certs to be # used are not being installed, so turn sslverify=0 on the # repository. diff --git a/templates/ubuntu/00-FROM.in b/templates/ubuntu/00-FROM.in index c441ee0..a32ec6b 100644 --- a/templates/ubuntu/00-FROM.in +++ b/templates/ubuntu/00-FROM.in @@ -1,3 +1,3 @@ -# Pull from the internal cache of images -FROM amr-registry.caas.intel.com/vtt-osgc/os/$OS_DISTRO:$OS_RELEASE AS base +# Pull from $OS_DISTRO on Docker Hub +FROM $OS_DISTRO:$OS_RELEASE AS base