1
0

Updated to work with latest xe-solutions

Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James Ketrenos 2019-11-14 13:04:22 -08:00
parent 4ce032c530
commit bdb996e07e
21 changed files with 385 additions and 200 deletions

View File

@ -15,7 +15,7 @@
# Template from templates/ubuntu/00-FROM.in
#
# Pull from ubuntu on Docker Hub
FROM ubuntu:disco AS graphics-base
FROM ubuntu:disco AS xe-base-stage
#
@ -32,15 +32,31 @@ RUN { \
done \
} > /etc/apt/sources.list
ARG http_proxy="http://proxy-chain.intel.com:911/"
ARG https_proxy="http://proxy-chain.intel.com:912/"
ARG ftp_proxy="ftp://proxy-chain.intel.com:911/"
ARG socks_proxy="socks://proxy-chain.intel.com:1080/"
ARG no_proxy="localhost,*.*.intel.com"
ENV http_proxy="${http_proxy}"
ENV https_proxy="${https_proxy}"
ENV no_proxy="${no_proxy}"
ENV ftp_proxy="${http_proxy}"
ENV socks_proxy="${socks_proxy}"
ENV HTTP_PROXY="${http_proxy}"
ENV HTTPS_PROXY="${http_proxy}"
ENV NO_PROXY="${no_proxy}"
RUN { \
echo "Acquire::http::proxy \"http://proxy-chain.intel.com:911/\";\n" ; \
echo "Acquire::https::proxy \"http://proxy-chain.intel.com:912/\";\n" ; \
echo "Acquire::ftp::proxy \"ftp://proxy-chain.intel.com:911/\";\n" ; \
echo "Acquire::socks::proxy \"socks://proxy-chain.intel.com:1080/\";\n" ; \
echo "Acquire::http::proxy \"${http_proxy}\";\n" ; \
echo "Acquire::https::proxy \"${https_proxy}\";\n" ; \
echo "Acquire::ftp::proxy \"${ftp_proxy}\";\n" ; \
echo "Acquire::socks::proxy \"${socks_proxy}\";\n" ; \
echo "Acquire::http::Proxy::linux-ftp.ostc.intel.com DIRECT;\n" ; \
echo "Acquire::http::Proxy::osgc.jf.intel.com DIRECT;\n" ; \
} > /etc/apt/apt.conf
#
# Template from templates/ubuntu/08-intel-certs.in
#
@ -85,8 +101,6 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
#
# Template from templates/ubuntu/20-repositories-intel-com.in
#
FROM base AS graphics-base
# Once we have a signed repository:
#
# Update and install gpg-agent as it isn't in the base Ubuntu image and
@ -120,30 +134,33 @@ RUN echo "deb [trusted=yes arch=amd64] https://repositories.intel.com/graphics/u
#
# 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'
# Create user 'user' and add them to 'sudo' for sudo access and set
# the passwd to 'user'
FROM graphics-base AS user-stage
FROM xe-base-stage AS xe-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}
&& apt-get install --no-install-recommends -y \
sudo
# 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
RUN groupadd -r user \
&& useradd --no-log-init \
-s /bin/bash \
-r -m \
-g user \
-G sudo \
-p $(echo "user" | openssl passwd -stdin) user
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
USER user
#
# Solution begins here (from Dockerfile.solution)
#
@ -156,59 +173,71 @@ 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 user-stage AS solution-build
FROM xe-user-stage AS solution-build
USER root
# 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 \
&& 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/graphics/ffmpeg
# Install all required common packages:
# Install all required Media common packages, broken out
# from the above command to highlight which packages are
# specific to media
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get -q -y install \
libva-dev$LIBVA_DEV_VERSION \
libmfx-dev$LIBMFX_DEV_VERSION \
libmfx1$LIBMFX1_VERSION \
vainfo$VAINFO_VERSION \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
vainfo$VAINFO_VERSION
ENV LIBVA_DRIVER_NAME=iHD
USER user
# 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/user/ffmpeg
# Build FFmpeg
WORKDIR /home/graphics/ffmpeg
WORKDIR /home/user/ffmpeg
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make -j $(nproc --all) \
&& make install
&& sudo make install
FROM user-stage
FROM xe-user-stage
ENV LIBVA_DRIVER_NAME=iHD
USER root
# 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.
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get --no-install-recommends -q -y install \
intel-media-va-driver-non-free$INTEL_MEDIA_VA_DRIVER_NON_FREE_VERSION \
libva2$LIBVA2_VERSION \
libmfx1$LIBMFX1_VERSION \
vainfo$VAINFO_VERSION \
libpciaccess0 \
pciutils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
pciutils
# Copy ffmpeg and ffprobe from build container
COPY --from=solution-build /usr/local/bin/ /usr/local/bin/
WORKDIR /home/graphics
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LIBVA_DRIVER_NAME=iHD
USER user
WORKDIR /home/user
#
# Standard ending begins here (from templates/ending.in)
@ -231,6 +260,6 @@ RUN { \
echo "PACKAGE_STREAM=disco" ; \
echo "OS_DISTRO=ubuntu" ; \
echo "OS_RELEASE=disco" ; \
} > /assets/SOLUTION
} | sudo tee /assets/SOLUTION
COPY MANIFEST /assets/
COPY Dockerfile /assets/Dockerfile

View File

@ -12,17 +12,45 @@
#
#
# Template from templates/rhel/00-everything.in
# Template from templates/rhel/00-from.in
#
FROM dockerv2-gfx-build.gfx-assets.intel.com/upstream/rhel:8.0.0 AS user-stage
# Pull internal RHEL image
FROM dockerv2-gfx-build.gfx-assets.intel.com/upstream/rhel:8.0.0 AS xe-base-stage
# Flush cached package lists to prevent stale data
RUN dnf clean all
#
# Template from templates/rhel/05-intel-proxy.in
#
# Configure Intel proxy values
ARG http_proxy="http://proxy-chain.intel.com:911/"
ARG https_proxy="http://proxy-chain.intel.com:912/"
ARG ftp_proxy="ftp://proxy-chain.intel.com:911/"
ARG socks_proxy="socks://proxy-chain.intel.com:1080/"
ARG no_proxy="localhost,*.*.intel.com"
ENV http_proxy="${http_proxy}"
ENV https_proxy="${https_proxy}"
ENV no_proxy="${no_proxy}"
ENV ftp_proxy="${http_proxy}"
ENV socks_proxy="${socks_proxy}"
ENV HTTP_PROXY="${http_proxy}"
ENV HTTPS_PROXY="${http_proxy}"
ENV NO_PROXY="${no_proxy}"
# Configure DNF and YUM proxies
RUN echo "proxy=http://proxy-chain.intel.com:911" >> /etc/dnf/dnf.conf \
&& echo -e 'proxy=http://proxy-chain.intel.com:911\nno_proxy=.intel.com' >> /etc/yum.conf
# Remove any pre-configured repositories
RUN rm -rf /etc/yum.repos.d/*
RUN { \
echo "proxy=${http_proxy}" ; \
echo "no_proxy=${no_proxy}" ; \
} | tee -a /etc/dnf/dnf.conf /etc/yum.conf
#
# Template from templates/rhel/10-rhel-partner.in
#
# Install the Red Hat partner repositories
RUN { \
echo "[RHEL-8-appstream-partners]" ; \
@ -181,12 +209,10 @@ RUN { \
echo "" ; \
} > /etc/yum.repos.d/RHEL-8-rt-intel-partner.repo
# Update package lists, and upgrade to the latest Red Hat packages
RUN dnf clean all \
&& dnf -y upgrade \
&& dnf clean all
# repositories.intel.com specific content begins here
#
# Template from templates/rhel/20-repositories-intel-com.in
#
# repositories.intel.com content begins here
#
# Intel certificates which would allow internal signed certs to be
# used are not being installed, so turn sslverify=0 on the
@ -211,8 +237,35 @@ RUN { \
echo "gpgcheck=0" ; \
} > /etc/yum.repos.d/intel-graphics.repo
# Disable proxy for Intel URLs
RUN echo "no_proxy=.jf.intel.com" >> /etc/yum.conf
#
# Template from templates/rhel/25-graphics-user.in
#
# Create user 'user' and add them to 'sudo' for sudo access and set
# the passwd to 'user'
FROM xe-base-stage AS xe-user-stage
RUN dnf install -y sudo
# NOTE: Requires 'sudo' package to already be installed
RUN groupadd -r user \
&& useradd --no-log-init \
-s /bin/bash \
-r -m \
-g user \
-G sudo \
-p $(echo "user" | openssl passwd -stdin) user
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
USER user
#
# Template from templates/rhel/30-clean-up.in
#
# Clean dnf cache
RUN dnf clean all
#
# Solution begins here (from Dockerfile.solution.rhel-8.0)
@ -225,53 +278,60 @@ RUN echo "no_proxy=.jf.intel.com" >> /etc/yum.conf
# image isn't polluted with build artifacts
#
# NOTE: This image will only work with Ubuntu 19.04 (disco) and newer
FROM user-stage AS solution-build
FROM xe-user-stage AS solution-build
USER root
# Install git and build tools, clone ffmpeg, and get ready to build it
RUN dnf groupinstall -y 'Development Tools'
# 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 /ffmpeg
# Install all required common packages:
# Adapted from
RUN dnf install -y \
libva-devel$LIBVA_DEV_VERSION \
intel-mediasdk-devel$INTEL_MEDIASDK_DEVEL_VERSION \
libva-utils$LIBVA_UTILS_VERSION \
&& dnf clean all
libva-utils$LIBVA_UTILS_VERSION
ENV LIBVA_DRIVER_NAME=iHD
USER user
# 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/user/ffmpeg
# Build FFmpeg
WORKDIR /ffmpeg
WORKDIR /home/user/ffmpeg
ENV LIBVA_DRIVER_NAME=iHD
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make -j $(nproc --all) \
&& make install
&& sudo make install
FROM user-stage
FROM xe-user-stage
ENV LIBVA_DRIVER_NAME=iHD
USER root
# 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.
# intel-media-va-driver-non-free$INTEL_MEDIA_VA_DRIVER_NON_FREE_VERSION \
# so explicitly install it.
RUN dnf install -y \
intel-media$INTEL_MEDIA_VERSION \
libva$LIBVA_VERSION \
intel-mediasdk$INTEL_MEDIASDK_VERSION \
libva-utils$LIBVA_UTILS_VERSION \
libpciaccess \
pciutils \
&& dnf clean all
pciutils
# Copy ffmpeg and ffprobe from build container
COPY --from=solution-build /usr/local/bin/ /usr/local/bin/
RUN dnf clean all
ENV LIBVA_DRIVER_NAME=iHD
USER user
#
# Standard ending begins here (from templates/ending.in)
#
@ -293,6 +353,6 @@ RUN { \
echo "PACKAGE_STREAM=8.0" ; \
echo "OS_DISTRO=rhel" ; \
echo "OS_RELEASE=8.0" ; \
} > /assets/SOLUTION
} | sudo tee /assets/SOLUTION
COPY MANIFEST /assets/
COPY Dockerfile.rhel-8.0 /assets/Dockerfile

View File

@ -7,56 +7,68 @@
# image isn't polluted with build artifacts
#
# NOTE: This image will only work with Ubuntu 19.04 (disco) and newer
FROM user-stage AS solution-build
FROM xe-user-stage AS solution-build
USER root
# 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 \
&& 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 $FFMPEG_TAG_VERSION https://github.com/ffmpeg/ffmpeg /home/graphics/ffmpeg
# Install all required common packages:
# Install all required Media common packages, broken out
# from the above command to highlight which packages are
# specific to media
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get -q -y install \
libva-dev$LIBVA_DEV_VERSION \
libmfx-dev$LIBMFX_DEV_VERSION \
libmfx1$LIBMFX1_VERSION \
vainfo$VAINFO_VERSION \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
vainfo$VAINFO_VERSION
ENV LIBVA_DRIVER_NAME=iHD
USER user
# 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/user/ffmpeg
# Build FFmpeg
WORKDIR /home/graphics/ffmpeg
WORKDIR /home/user/ffmpeg
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make -j $(nproc --all) \
&& make install
&& sudo make install
FROM user-stage
FROM xe-user-stage
ENV LIBVA_DRIVER_NAME=iHD
USER root
# 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.
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \
&& DEBIAN_FRONTEND=noninteractive \
&& apt-get --no-install-recommends -q -y install \
intel-media-va-driver-non-free$INTEL_MEDIA_VA_DRIVER_NON_FREE_VERSION \
libva2$LIBVA2_VERSION \
libmfx1$LIBMFX1_VERSION \
vainfo$VAINFO_VERSION \
libpciaccess0 \
pciutils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
pciutils
# Copy ffmpeg and ffprobe from build container
COPY --from=solution-build /usr/local/bin/ /usr/local/bin/
WORKDIR /home/graphics
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LIBVA_DRIVER_NAME=iHD
USER user
WORKDIR /home/user

View File

@ -6,49 +6,56 @@
# image isn't polluted with build artifacts
#
# NOTE: This image will only work with Ubuntu 19.04 (disco) and newer
FROM user-stage AS solution-build
FROM xe-user-stage AS solution-build
USER root
# Install git and build tools, clone ffmpeg, and get ready to build it
RUN dnf groupinstall -y 'Development Tools'
# 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 /ffmpeg
# Install all required common packages:
# Adapted from
RUN dnf install -y \
libva-devel$LIBVA_DEV_VERSION \
intel-mediasdk-devel$INTEL_MEDIASDK_DEVEL_VERSION \
libva-utils$LIBVA_UTILS_VERSION \
&& dnf clean all
libva-utils$LIBVA_UTILS_VERSION
ENV LIBVA_DRIVER_NAME=iHD
USER user
# 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/user/ffmpeg
# Build FFmpeg
WORKDIR /ffmpeg
WORKDIR /home/user/ffmpeg
ENV LIBVA_DRIVER_NAME=iHD
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make -j $(nproc --all) \
&& make install
&& sudo make install
FROM user-stage
FROM xe-user-stage
ENV LIBVA_DRIVER_NAME=iHD
USER root
# 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.
# intel-media-va-driver-non-free$INTEL_MEDIA_VA_DRIVER_NON_FREE_VERSION \
# so explicitly install it.
RUN dnf install -y \
intel-media$INTEL_MEDIA_VERSION \
libva$LIBVA_VERSION \
intel-mediasdk$INTEL_MEDIASDK_VERSION \
libva-utils$LIBVA_UTILS_VERSION \
libpciaccess \
pciutils \
&& dnf clean all
pciutils
# Copy ffmpeg and ffprobe from build container
COPY --from=solution-build /usr/local/bin/ /usr/local/bin/
RUN dnf clean all
ENV LIBVA_DRIVER_NAME=iHD
USER user

View File

@ -0,0 +1,6 @@
# Pull $OS_DISTRO from Docker Hub
FROM $OS_DISTRO:$OS_RELEASE as xe-base-stage
# Flush cached package lists to prevent stale data
RUN dnf clean all

View File

@ -0,0 +1,23 @@
# Configure Intel proxy values
ARG http_proxy="http://proxy-chain.intel.com:911/"
ARG https_proxy="http://proxy-chain.intel.com:912/"
ARG ftp_proxy="ftp://proxy-chain.intel.com:911/"
ARG socks_proxy="socks://proxy-chain.intel.com:1080/"
ARG no_proxy="localhost,*.*.intel.com"
ENV http_proxy="${http_proxy}"
ENV https_proxy="${https_proxy}"
ENV no_proxy="${no_proxy}"
ENV ftp_proxy="${http_proxy}"
ENV socks_proxy="${socks_proxy}"
ENV HTTP_PROXY="${http_proxy}"
ENV HTTPS_PROXY="${http_proxy}"
ENV NO_PROXY="${no_proxy}"
# Configure DNF and YUM proxies
RUN { \
echo "proxy=${http_proxy}" ; \
echo "no_proxy=${no_proxy}" ; \
} | tee -a /etc/dnf/dnf.conf /etc/yum.conf

View File

@ -1,15 +1,3 @@
# Pull $OS_DISTRO from Docker Hub
FROM $OS_DISTRO:$OS_RELEASE as user-stage
# Configure DNF and YUM proxies
RUN echo "proxy=http://proxy-chain.intel.com:911" >> /etc/dnf/dnf.conf \
&& echo -e 'proxy=http://proxy-chain.intel.com:911\nno_proxy=.intel.com' >> /etc/yum.conf
# Update package lists, and upgrade to the latest Red Hat packages
RUN dnf clean all \
&& dnf -y upgrade \
&& dnf clean all
# repositories.intel.com content begins here
#
# Intel certificates which would allow internal signed certs to be
@ -34,6 +22,3 @@ RUN { \
echo "enabled=1" ; \
echo "gpgcheck=0" ; \
} > /etc/yum.repos.d/intel-graphics.repo
# Disable proxy for Intel URLs
RUN echo "no_proxy=.jf.intel.com" >> /etc/yum.conf

View File

@ -0,0 +1,20 @@
# Create user 'user' and add them to 'sudo' for sudo access and set
# the passwd to 'user'
FROM xe-base-stage AS xe-user-stage
RUN dnf install -y sudo
# NOTE: Requires 'sudo' package to already be installed
RUN groupadd -r user \
&& useradd --no-log-init \
-s /bin/bash \
-r -m \
-g user \
-G sudo \
-p $(echo "user" | openssl passwd -stdin) user
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
USER user

View File

@ -0,0 +1,2 @@
# Clean dnf cache
RUN dnf clean all

View File

@ -16,6 +16,6 @@ RUN { \
echo "PACKAGE_STREAM=${PACKAGE_STREAM}" ; \
echo "OS_DISTRO=${OS_DISTRO}" ; \
echo "OS_RELEASE=${OS_RELEASE}" ; \
} > /assets/SOLUTION
} | sudo tee /assets/SOLUTION
COPY MANIFEST /assets/
COPY ${DOCKERFILE} /assets/Dockerfile

View File

@ -0,0 +1,6 @@
# Pull internal RHEL image
FROM dockerv2-gfx-build.gfx-assets.intel.com/upstream/rhel:8.0.0 AS xe-base-stage
# Flush cached package lists to prevent stale data
RUN dnf clean all

View File

@ -0,0 +1,23 @@
# Configure Intel proxy values
ARG http_proxy="http://proxy-chain.intel.com:911/"
ARG https_proxy="http://proxy-chain.intel.com:912/"
ARG ftp_proxy="ftp://proxy-chain.intel.com:911/"
ARG socks_proxy="socks://proxy-chain.intel.com:1080/"
ARG no_proxy="localhost,*.*.intel.com"
ENV http_proxy="${http_proxy}"
ENV https_proxy="${https_proxy}"
ENV no_proxy="${no_proxy}"
ENV ftp_proxy="${http_proxy}"
ENV socks_proxy="${socks_proxy}"
ENV HTTP_PROXY="${http_proxy}"
ENV HTTPS_PROXY="${http_proxy}"
ENV NO_PROXY="${no_proxy}"
# Configure DNF and YUM proxies
RUN { \
echo "proxy=${http_proxy}" ; \
echo "no_proxy=${no_proxy}" ; \
} | tee -a /etc/dnf/dnf.conf /etc/yum.conf

View File

@ -1,12 +1,3 @@
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 \
&& echo -e 'proxy=http://proxy-chain.intel.com:911\nno_proxy=.intel.com' >> /etc/yum.conf
# Remove any pre-configured repositories
RUN rm -rf /etc/yum.repos.d/*
# Install the Red Hat partner repositories
RUN { \
echo "[RHEL-8-appstream-partners]" ; \
@ -164,36 +155,3 @@ RUN { \
echo "skip_if_unavailable=1" ; \
echo "" ; \
} > /etc/yum.repos.d/RHEL-8-rt-intel-partner.repo
# Update package lists, and upgrade to the latest Red Hat packages
RUN dnf clean all \
&& dnf -y upgrade \
&& dnf clean all
# 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.
#
# To install the certs would be something like:
#
# A. Copy ca certs to /etc/pki/ca-trust/source/anchors/
# B. run update-ca-trust
#
# Once that is done, the 'sslverify=0' can be removed from
# the repository definition below.
#
# Add Intel Graphics repository
#
RUN { \
echo "[intel-graphics]" ; \
echo "name=Intel Graphics Drivers Repository" ; \
echo "baseurl=${PACKAGE_REPOSITORY}/${OS_DISTRO}/${PACKAGE_STREAM}/" ; \
echo "sslverify=0" ; \
echo "enabled=1" ; \
echo "gpgcheck=0" ; \
} > /etc/yum.repos.d/intel-graphics.repo
# Disable proxy for Intel URLs
RUN echo "no_proxy=.jf.intel.com" >> /etc/yum.conf

View File

@ -0,0 +1,24 @@
# repositories.intel.com 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.
#
# To install the certs would be something like:
#
# A. Copy ca certs to /etc/pki/ca-trust/source/anchors/
# B. run update-ca-trust
#
# Once that is done, the 'sslverify=0' can be removed from
# the repository definition below.
#
# Add Intel Graphics repository
#
RUN { \
echo "[intel-graphics]" ; \
echo "name=Intel Graphics Drivers Repository" ; \
echo "baseurl=${PACKAGE_REPOSITORY}/${OS_DISTRO}/${PACKAGE_STREAM}/" ; \
echo "sslverify=0" ; \
echo "enabled=1" ; \
echo "gpgcheck=0" ; \
} > /etc/yum.repos.d/intel-graphics.repo

View File

@ -0,0 +1,20 @@
# Create user 'user' and add them to 'sudo' for sudo access and set
# the passwd to 'user'
FROM xe-base-stage AS xe-user-stage
RUN dnf install -y sudo
# NOTE: Requires 'sudo' package to already be installed
RUN groupadd -r user \
&& useradd --no-log-init \
-s /bin/bash \
-r -m \
-g user \
-G sudo \
-p $(echo "user" | openssl passwd -stdin) user
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
USER user

View File

@ -0,0 +1,2 @@
# Clean dnf cache
RUN dnf clean all

View File

@ -1,3 +1,3 @@
# Pull from $OS_DISTRO on Docker Hub
FROM $OS_DISTRO:$OS_RELEASE AS graphics-base
FROM $OS_DISTRO:$OS_RELEASE AS xe-base-stage

View File

@ -9,11 +9,27 @@ RUN { \
done \
} > /etc/apt/sources.list
ARG http_proxy="http://proxy-chain.intel.com:911/"
ARG https_proxy="http://proxy-chain.intel.com:912/"
ARG ftp_proxy="ftp://proxy-chain.intel.com:911/"
ARG socks_proxy="socks://proxy-chain.intel.com:1080/"
ARG no_proxy="localhost,*.*.intel.com"
ENV http_proxy="${http_proxy}"
ENV https_proxy="${https_proxy}"
ENV no_proxy="${no_proxy}"
ENV ftp_proxy="${http_proxy}"
ENV socks_proxy="${socks_proxy}"
ENV HTTP_PROXY="${http_proxy}"
ENV HTTPS_PROXY="${http_proxy}"
ENV NO_PROXY="${no_proxy}"
RUN { \
echo "Acquire::http::proxy \"http://proxy-chain.intel.com:911/\";\n" ; \
echo "Acquire::https::proxy \"http://proxy-chain.intel.com:912/\";\n" ; \
echo "Acquire::ftp::proxy \"ftp://proxy-chain.intel.com:911/\";\n" ; \
echo "Acquire::socks::proxy \"socks://proxy-chain.intel.com:1080/\";\n" ; \
echo "Acquire::http::proxy \"${http_proxy}\";\n" ; \
echo "Acquire::https::proxy \"${https_proxy}\";\n" ; \
echo "Acquire::ftp::proxy \"${ftp_proxy}\";\n" ; \
echo "Acquire::socks::proxy \"${socks_proxy}\";\n" ; \
echo "Acquire::http::Proxy::linux-ftp.ostc.intel.com DIRECT;\n" ; \
echo "Acquire::http::Proxy::osgc.jf.intel.com DIRECT;\n" ; \
} > /etc/apt/apt.conf

View File

@ -1,9 +0,0 @@
# 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 \"http://proxy-chain.intel.com:912/\";\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

View File

@ -1,5 +1,3 @@
FROM base AS graphics-base
# Once we have a signed repository:
#
# Update and install gpg-agent as it isn't in the base Ubuntu image and

View File

@ -1,23 +1,26 @@
# Create user 'graphics' and add them to 'sudo' for sudo access and set
# the passwd to 'graphics'
# Create user 'user' and add them to 'sudo' for sudo access and set
# the passwd to 'user'
FROM graphics-base AS user-stage
FROM xe-base-stage AS xe-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}
&& apt-get install --no-install-recommends -y \
sudo
# 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
RUN groupadd -r user \
&& useradd --no-log-init \
-s /bin/bash \
-r -m \
-g user \
-G sudo \
-p $(echo "user" | openssl passwd -stdin) user
# Set 'sudo' to NOPASSWD for all container users
RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
USER user