diff --git a/assets/entry b/assets/entry index e4108d4..c5b2c93 100755 --- a/assets/entry +++ b/assets/entry @@ -17,6 +17,7 @@ done . /assets/SOLUTION . /assets/MANIFEST +. /etc/os-release name() { cat << EOF @@ -37,11 +38,11 @@ info() { cat << EOF $(name) -Container base OS : ${OS_DISTRO} ${OS_RELEASE} +Container base OS : ${NAME} ${VERSION} Release information: ${RELEASE_INFO} Detected hardware : ${HW} -Package repository : ${PACKAGE_REPOSITORY} -Package stream : ${OS_DISTRO}-${PACKAGE_STREAM} +Package repository : ${GPGPU_PACKAGE_REPOSITORY} +Package stream : ${GPGPU_PACKAGE_STREAM} EOF } diff --git a/scripts/build-dockerfile.sh b/scripts/build-dockerfile.sh index 3cabdb6..48e2998 100755 --- a/scripts/build-dockerfile.sh +++ b/scripts/build-dockerfile.sh @@ -86,7 +86,7 @@ EOM SNIPPETS=() # Create a list of all the templates for this distro -for snippet in templates/${OS_DISTRO}/??-*.in; do +for snippet in templates/??-*.in templates/${OS_DISTRO}/??-*.in; do if [[ "${TEMPLATE_IGNORE}" != "" ]] && [[ ${snippet} =~ ${TEMPLATE_IGNORE} ]]; then continue fi diff --git a/scripts/test-image.sh b/scripts/test-image.sh index 1d3d688..08e897e 100755 --- a/scripts/test-image.sh +++ b/scripts/test-image.sh @@ -74,7 +74,11 @@ ADD_GROUPS="--group-add ${VIDEO}" [[ "${RENDER}" != "" ]] && ADD_GROUPS+=" --group-add ${RENDER}" [[ -e data/ ]] || mkdir data || fail "Unable to make data volume directory" -chmod a+rwX data || fail "Unable to chmod data volume to a+rwX" +chown :${VIDEO} data || { + >&2 echo "Unable to chown data volume to video:${VIDEO}" + fail "Make sure you are in the 'video' group (usermod -a -G video \$(whoami))" +} +chmod g+rwX data || fail "Unable to chmod data volume to g+rwX" CMD="docker run \ ${ADD_GROUPS} ${DOCKER_ARGS} \ diff --git a/templates/01-env.in b/templates/01-env.in new file mode 100644 index 0000000..49f43b2 --- /dev/null +++ b/templates/01-env.in @@ -0,0 +1,7 @@ +# Configure ENV variables which are set by scripts/build-dockerfile.sh +# and available in the container for use in assets/entry + +ENV GPGPU_PACKAGE_REPOSITORY "${PACKAGE_REPOSITORY}" +ENV GPGPU_PACKAGE_STREAM "${PACKAGE_STREAM}" +ENV GPGPU_PACKAGE_DISTRO "${OS_DISTRO}" +ENV GPGPU_PACKAGE_DISTRO_RELEASE "${OS_RELEASE}" diff --git a/templates/sles/05-intel-proxy.in b/templates/sles/05-intel-proxy.in new file mode 100644 index 0000000..54085f8 --- /dev/null +++ b/templates/sles/05-intel-proxy.in @@ -0,0 +1,29 @@ +# 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 system-wide proxies. +# https://www.suse.com/support/kb/doc/?id=000017441 + +RUN { \ + echo "PROXY_ENABLED=\"yes\"" ; \ + echo "HTTP_PROXY=\"${http_proxy}\"" ; \ + echo "HTTPS_PROXY=\"${https_proxy}\"" ; \ + echo "FTP_PROXY=\"${ftp_proxy}\"" ; \ + echo "SOCKS_PROXY=\"${socks_proxy}\"" ; \ + echo "NO_PROXY=\"${no_proxy}\"" ; \ +} | tee -a /etc/sysconfig/proxy diff --git a/templates/sles/10-default-packages.in b/templates/sles/10-default-packages.in new file mode 100644 index 0000000..001948b --- /dev/null +++ b/templates/sles/10-default-packages.in @@ -0,0 +1,15 @@ +# Install default packages. + +RUN zypper --gpg-auto-import-keys -q ref -s \ + && zypper --no-color -qn install --no-recommends -y \ + unzip \ + gzip \ + wget \ + ca-certificates + +# TODO: Configure locale. + +# RUN zypper --no-color -qn install --no-recommends -y \ +# glibc-i18ndata \ +# && localedef -v -c -i us_US -f UTF-8 us_US.UTF-8 \ +# ENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 diff --git a/templates/sles/13-intel-certs.in b/templates/sles/13-intel-certs.in new file mode 100644 index 0000000..8af7e02 --- /dev/null +++ b/templates/sles/13-intel-certs.in @@ -0,0 +1,13 @@ +# Configure certificates. + +ARG DIR_CERT="/etc/pki/trust/anchors" + +RUN cd /tmp \ + && mkdir -pv $DIR_CERT \ + && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/IntelSHA2RootChain-Base64.zip \ + && unzip -qo tmp.zip -d $DIR_CERT \ + && rm tmp.zip \ + && wget -qO tmp.zip http://certificates.intel.com/repository/certificates/Intel%20Root%20Certificate%20Chain%20Base64.zip \ + && unzip -qo tmp.zip -d $DIR_CERT \ + && rm tmp.zip \ + && update-ca-certificates diff --git a/templates/sles/15-upgrade-packages.in b/templates/sles/15-upgrade-packages.in new file mode 100644 index 0000000..5494f05 --- /dev/null +++ b/templates/sles/15-upgrade-packages.in @@ -0,0 +1,4 @@ +# Add repo, Update package lists, and upgrade to the latest package versions. + +#RUN SUSEConnect -p PackageHub/15.1/x86_64 \ +# && zypper -qn update -y diff --git a/templates/sles/15sp1/00-from.in b/templates/sles/15sp1/00-from.in new file mode 100644 index 0000000..55929da --- /dev/null +++ b/templates/sles/15sp1/00-from.in @@ -0,0 +1,3 @@ +# Pull internal sles 15sp1 image. + +FROM dockerv2-gfx-build.gfx-assets.intel.com/upstream/sle15:15.1 AS xe-base-stage diff --git a/templates/sles/15sp1/05-sles-partner.in b/templates/sles/15sp1/05-sles-partner.in new file mode 100644 index 0000000..6514d68 --- /dev/null +++ b/templates/sles/15sp1/05-sles-partner.in @@ -0,0 +1,21 @@ +# SLES Credentials from SUSE 15 SP1 system running on runner +RUN { \ + echo 'username=SCC_c5abd61dd7694806ae31e93237d2de84' ; \ + echo 'password=464557c9f9974a49' ; \ +} > /etc/zypp/credentials.d/Basesystem_Module_15_SP1_x86_64 +RUN { \ + echo 'username=SCC_c5abd61dd7694806ae31e93237d2de84' ; \ + echo 'password=464557c9f9974a49' ; \ +} > /etc/zypp/credentials.d/Containers_Module_15_SP1_x86_64 +RUN { \ + echo 'username=SCC_c5abd61dd7694806ae31e93237d2de84' ; \ + echo 'password=464557c9f9974a49' ; \ +} > /etc/zypp/credentials.d/SCCcredentials +RUN { \ + echo 'username=SCC_c5abd61dd7694806ae31e93237d2de84' ; \ + echo 'password=464557c9f9974a49' ; \ +} > /etc/zypp/credentials.d/Server_Applications_Module_15_SP1_x86_64 +RUN { \ + echo 'username=SCC_c5abd61dd7694806ae31e93237d2de84' ; \ + echo 'password=464557c9f9974a49' ; \ +} > /etc/zypp/credentials.d/SUSE_Linux_Enterprise_Server_15_SP1_x86_64 diff --git a/templates/sles/15sp1/06-sles-services.in b/templates/sles/15sp1/06-sles-services.in new file mode 100644 index 0000000..46bd5af --- /dev/null +++ b/templates/sles/15sp1/06-sles-services.in @@ -0,0 +1,97 @@ +# SLES services from SUSE 15 SP1 system running on runner +RUN { \ + echo '[Basesystem_Module_15_SP1_x86_64]' ; \ + echo 'enabled=0' ; \ + echo 'autorefresh=0' ; \ + echo 'url = https://scc.suse.com/access/services/1757?credentials=Basesystem_Module_15_SP1_x86_64' ; \ + echo 'type = ris' ; \ + echo 'ttl_sec = 86400' ; \ + echo 'lrf_dat = 1588162730' ; \ + echo 'repo_1=Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Debuginfo-Pool' ; \ + echo 'repo_1_enabled=0' ; \ + echo 'repo_1_autorefresh=0' ; \ + echo 'repo_2=Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Debuginfo-Updates' ; \ + echo 'repo_2_enabled=0' ; \ + echo 'repo_2_autorefresh=0' ; \ + echo 'repo_3=Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Pool' ; \ + echo 'repo_3_enabled=1' ; \ + echo 'repo_3_autorefresh=0' ; \ + echo 'repo_4=Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Source-Pool' ; \ + echo 'repo_4_enabled=0' ; \ + echo 'repo_4_autorefresh=0' ; \ + echo 'repo_5=Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Updates' ; \ + echo 'repo_5_enabled=1' ; \ + echo 'repo_5_autorefresh=0' ; \ +} > /etc/zypp/services.d/Basesystem_Module_15_SP1_x86_64.service +RUN { \ + echo '[Containers_Module_15_SP1_x86_64]' ; \ + echo 'enabled=0' ; \ + echo 'autorefresh=0' ; \ + echo 'url = https://scc.suse.com/access/services/1775?credentials=Containers_Module_15_SP1_x86_64' ; \ + echo 'type = ris' ; \ + echo 'ttl_sec = 86400' ; \ + echo 'lrf_dat = 1588195270' ; \ + echo 'repo_1=Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Debuginfo-Pool' ; \ + echo 'repo_1_enabled=0' ; \ + echo 'repo_1_autorefresh=0' ; \ + echo 'repo_2=Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Debuginfo-Updates' ; \ + echo 'repo_2_enabled=0' ; \ + echo 'repo_2_autorefresh=0' ; \ + echo 'repo_3=Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Pool' ; \ + echo 'repo_3_enabled=1' ; \ + echo 'repo_3_autorefresh=0' ; \ + echo 'repo_4=Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Source-Pool' ; \ + echo 'repo_4_enabled=0' ; \ + echo 'repo_4_autorefresh=0' ; \ + echo 'repo_5=Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Updates' ; \ + echo 'repo_5_enabled=1' ; \ + echo 'repo_5_autorefresh=0' ; \ +} > /etc/zypp/services.d/Containers_Module_15_SP1_x86_64.service +RUN { \ + echo '[Server_Applications_Module_15_SP1_x86_64]' ; \ + echo 'enabled=0' ; \ + echo 'autorefresh=0' ; \ + echo 'url = https://scc.suse.com/access/services/1765?credentials=Server_Applications_Module_15_SP1_x86_64' ; \ + echo 'type = ris' ; \ + echo 'ttl_sec = 86400' ; \ + echo 'lrf_dat = 1588162732' ; \ + echo 'repo_1=Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Debuginfo-Pool' ; \ + echo 'repo_1_enabled=0' ; \ + echo 'repo_1_autorefresh=0' ; \ + echo 'repo_2=Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Debuginfo-Updates' ; \ + echo 'repo_2_enabled=0' ; \ + echo 'repo_2_autorefresh=0' ; \ + echo 'repo_3=Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Pool' ; \ + echo 'repo_3_enabled=1' ; \ + echo 'repo_3_autorefresh=0' ; \ + echo 'repo_4=Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Source-Pool' ; \ + echo 'repo_4_enabled=0' ; \ + echo 'repo_4_autorefresh=0' ; \ + echo 'repo_5=Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Updates' ; \ + echo 'repo_5_enabled=1' ; \ + echo 'repo_5_autorefresh=0' ; \ +} > /etc/zypp/services.d/Server_Applications_Module_15_SP1_x86_64.service +RUN { \ + echo '[SUSE_Linux_Enterprise_Server_15_SP1_x86_64]' ; \ + echo 'enabled=0' ; \ + echo 'autorefresh=0' ; \ + echo 'url = https://scc.suse.com/access/services/1748?credentials=SUSE_Linux_Enterprise_Server_15_SP1_x86_64' ; \ + echo 'type = ris' ; \ + echo 'ttl_sec = 86400' ; \ + echo 'lrf_dat = 1588162731' ; \ + echo 'repo_1=SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Debuginfo-Pool' ; \ + echo 'repo_1_enabled=0' ; \ + echo 'repo_1_autorefresh=0' ; \ + echo 'repo_2=SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Debuginfo-Updates' ; \ + echo 'repo_2_enabled=0' ; \ + echo 'repo_2_autorefresh=0' ; \ + echo 'repo_3=SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Pool' ; \ + echo 'repo_3_enabled=1' ; \ + echo 'repo_3_autorefresh=0' ; \ + echo 'repo_4=SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Source-Pool' ; \ + echo 'repo_4_enabled=0' ; \ + echo 'repo_4_autorefresh=0' ; \ + echo 'repo_5=SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Updates' ; \ + echo 'repo_5_enabled=1' ; \ + echo 'repo_5_autorefresh=0' ; \ +} > /etc/zypp/services.d/SUSE_Linux_Enterprise_Server_15_SP1_x86_64.service diff --git a/templates/sles/15sp1/07-sles-repos.in b/templates/sles/15sp1/07-sles-repos.in new file mode 100644 index 0000000..7c383a0 --- /dev/null +++ b/templates/sles/15sp1/07-sles-repos.in @@ -0,0 +1,73 @@ +# SLES repos from SUSE 15 SP1 system running on runner +RUN { \ + echo '[Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Pool]' ; \ + echo 'name=SLE-Module-Basesystem15-SP1-Pool' ; \ + echo 'enabled=1' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Products/SLE-Module-Basesystem/15-SP1/x86_64/product?5JjCWdw0LvFPq4mnj2HyOmNH2jvoPNURks1-1vgkLa4OZiRcas98nOt3VU8n4t6C7mLiMTGKy3eWIx1b2yB2KwspcMJ-I91HXeZzkDUX_kVel6_8TWBiRZcnhIOGuS_G8Trc6jCo8jdpe5pabsMjxDKa7ME7D4UW' ; \ + echo 'type=rpm-md' ; \ + echo 'service=Basesystem_Module_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Pool.repo +RUN { \ + echo '[Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Updates]' ; \ + echo 'name=SLE-Module-Basesystem15-SP1-Updates' ; \ + echo 'enabled=1' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Updates/SLE-Module-Basesystem/15-SP1/x86_64/update?mJim9GAQR5b27_BuNHTH7uu2ighgoCJ_1lsxbvFko1zX-rdrWn73BI49EMs6eS08ZClyvGlB3Ef9_oWs2k8PqeP2fUMZafodQlOYh9opo5eBGVHRR8kxE9aAlAozAzQ8ZBCDzxXhb9-xgkvV-TL1mpGEyzNUpg' ; \ + echo 'type=rpm-md' ; \ + echo 'service=Basesystem_Module_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/Basesystem_Module_15_SP1_x86_64:SLE-Module-Basesystem15-SP1-Updates.repo +RUN { \ + echo '[Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Pool]' ; \ + echo 'name=SLE-Module-Containers15-SP1-Pool' ; \ + echo 'enabled=0' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Products/SLE-Module-Containers/15-SP1/x86_64/product?j50Ok6Folzro-XnALQPhSnCSMnH9v2iutK7oOsETRuQ473r__DRNOs1EecVNMCNZ4htPNRYZOkYI-LJGuqWzh1cZu7JDkCuCl4fnVqyybCfWUzLRIfQwEX7uUiv32t9liTuEZfHtUGlVpKQIDUgcf-YDeAqbTH5T' ; \ + echo 'type=rpm-md' ; \ + echo 'service=Containers_Module_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Pool.repo +RUN { \ + echo '[Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Updates]' ; \ + echo 'name=SLE-Module-Containers15-SP1-Updates' ; \ + echo 'enabled=0' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Updates/SLE-Module-Containers/15-SP1/x86_64/update?n9By4Y7aH3GZMx6tsAphwiGrW6DGCgi7v3UynbWghO6qcilAHeUoPQda8VBZ3H193hLNFYac0m8HMUHqmUXXxp37KGXyKQROO5H_B0nh12GRBeLnPrNZWfsx0ntyZT9B4KXJ3ziJLOAnWbyNqtVyDbIyzolLFg' ; \ + echo 'type=rpm-md' ; \ + echo 'service=Containers_Module_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/Containers_Module_15_SP1_x86_64:SLE-Module-Containers15-SP1-Updates.repo +RUN { \ + echo '[Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Pool]' ; \ + echo 'name=SLE-Module-Server-Applications15-SP1-Pool' ; \ + echo 'enabled=1' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Products/SLE-Module-Server-Applications/15-SP1/x86_64/product?o6dg-g4PYjYkQa_NzY58ODws_4lrzomkB3UcoLgkN3csggGJrTl6F1XkALq0Qm6jpgP34-ovDtPm8HMIE6n73zFhVvgxqZm2hIcZRkexnWJHv0hW1Mqkud_gBlTiZnTRsYLq71y_iH3h9ZTLo19_zxjnR3uSXsWVg1zPbU884_HV' ; \ + echo 'type=rpm-md' ; \ + echo 'service=Server_Applications_Module_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Pool.repo +RUN { \ + echo '[Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Updates]' ; \ + echo 'name=SLE-Module-Server-Applications15-SP1-Updates' ; \ + echo 'enabled=1' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Updates/SLE-Module-Server-Applications/15-SP1/x86_64/update?w36X5rNnBUUwa8bW4o0h_qCYRzuSfClE1ZcK54987H87rmWrfdZLz5NTHIwof3cvcSzRtPand2KM-jPsc6xOg5NqnWYAWaAoLd3bac76UBiHki4lplPPcuiomUzLO3NPPPBkO5hJGz9fask4Vgqq0jtGzB_HSwjrMFF6bQJP5w' ; \ + echo 'type=rpm-md' ; \ + echo 'service=Server_Applications_Module_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/Server_Applications_Module_15_SP1_x86_64:SLE-Module-Server-Applications15-SP1-Updates.repo +RUN { \ + echo '[SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Pool]' ; \ + echo 'name=SLE-Product-SLES15-SP1-Pool' ; \ + echo 'enabled=1' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Products/SLE-Product-SLES/15-SP1/x86_64/product?YTHij6Qz-bCOv4_FIeNSUw4vbL-NChwl62645xM3ccC9gMWc-qjS4F60XhChL4odR56ZTJ4e8iK7Sfc2iFK7mf2IILBOTzdnnmGePnmh-0rMZE1PgKwCEwWCtvM2wl8nIqt7tv7E5oGESUb0x7QDl17RvA' ; \ + echo 'type=rpm-md' ; \ + echo 'service=SUSE_Linux_Enterprise_Server_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Pool.repo +RUN { \ + echo '[SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Updates]' ; \ + echo 'name=SLE-Product-SLES15-SP1-Updates' ; \ + echo 'enabled=1' ; \ + echo 'autorefresh=0' ; \ + echo 'baseurl=https://updates.suse.com/SUSE/Updates/SLE-Product-SLES/15-SP1/x86_64/update?ORXkypL_xSCEGUz-4tPnwu34UCYMDD80s1cfpxvziuDuGzBOhkDcI6Od4jRUx2jzQOQPxXsHsrzZ7lfXnzXpEu9W83mnmCLSzHWJaJOevmiOk1uF9v7ehvo_8QPVGnMLhaHUsSO7EKbp92EJUjGGiig' ; \ + echo 'type=rpm-md' ; \ + echo 'service=SUSE_Linux_Enterprise_Server_15_SP1_x86_64' ; \ +} > /etc/zypp/repos.d/SUSE_Linux_Enterprise_Server_15_SP1_x86_64:SLE-Product-SLES15-SP1-Updates.repo diff --git a/templates/sles/20-repositories-intel-com.in b/templates/sles/20-repositories-intel-com.in new file mode 100644 index 0000000..0e521fa --- /dev/null +++ b/templates/sles/20-repositories-intel-com.in @@ -0,0 +1,19 @@ +# 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. +# +# Fore certs configuration details see: 06-intel-certs.in +# +# Following certs configuration, the 'sslverify=0' can be removed from +# the repository definition below. + +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/zypp/repos.d/intel-graphics.repo diff --git a/templates/sles/25-create-user.in b/templates/sles/25-create-user.in new file mode 100644 index 0000000..0e421b3 --- /dev/null +++ b/templates/sles/25-create-user.in @@ -0,0 +1,30 @@ +# Create user 'user' and add them to 'sudo' access and set +# the passwd to 'user'. + +FROM xe-base-stage AS xe-user-stage + +USER root + +RUN zypper install -y sudo + +# NOTE: Requires 'sudo' package to already be installed. + +ARG USERNAME=user +ARG USER_UID=1000 +ARG USER_GID=1000 + +RUN echo "Creating 'user': $USER_UID:$USER_GID" + +RUN groupadd -r ${USERNAME} \ + && useradd --no-log-init \ + -s /bin/bash \ + -m \ + -u ${USER_UID} \ + -g ${USERNAME} \ + -G users,video \ + -p $(echo "${USERNAME}" | openssl passwd -stdin) ${USERNAME} + +# Change ALL ALL=(ALL) ALL to use '%users...NOPASSWD:ALL' +RUN sed -i -e 's,^ALL.*,%users ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers + +USER user diff --git a/templates/sles/30-clean-up.in.ignore b/templates/sles/30-clean-up.in.ignore new file mode 100644 index 0000000..924b1d2 --- /dev/null +++ b/templates/sles/30-clean-up.in.ignore @@ -0,0 +1,7 @@ +# Clean zypper cache. + +USER root + +RUN zypper clean --all + +USER user diff --git a/templates/sles/README.md b/templates/sles/README.md new file mode 100644 index 0000000..afade5b --- /dev/null +++ b/templates/sles/README.md @@ -0,0 +1,49 @@ +# To upgrade to a minor release + +Copy 15sp1/00-from.in to 15sp2/00-from.in + +Change sp1 and 15.1 to sp2 and 15.2. + +Generate a new 10-sles-partner.in file, which assumes we have +build containers already for the target distro and the partner +keys exist on a bare metal system we can populate into +../../sles + +```bash +export OS_RELEASE=15sp1 + +TARGET=${OS_RELEASE}/05-sles-partner.in +CREDS=../../../sles/${OS_RELEASE}/credentials +[ ! -d $(dirname ${TARGET}) ] && mkdir $(dirname ${TARGET}) +cat << EOF > ${TARGET} +# SLES Credentials from SUSE 15 SP1 system running on runner +EOF +for cred in ${CREDS}/*; do +echo "RUN { \\" +cat "${cred}" | while read line; do echo " echo '${line//\"/\\\"}' ; \\"; done +echo "} > /etc/zypp/credentials.d/$(basename ${cred})" +done >> ${TARGET} + +TARGET=${OS_RELEASE}/06-sles-services.in +SERVICES=../../../sles/${OS_RELEASE}/services +cat << EOF > ${TARGET} +# SLES services from SUSE 15 SP1 system running on runner +EOF +for service in ${SERVICES}/*; do +echo "RUN { \\" +cat "${service}" | while read line; do echo " echo '${line//\"/\\\"}' ; \\"; done +echo "} > /etc/zypp/services.d/$(basename ${service})" +done >> ${TARGET} + +TARGET=${OS_RELEASE}/07-sles-repos.in +REPOS=../../../sles/${OS_RELEASE}/repos +cat << EOF > ${TARGET} +# SLES repos from SUSE 15 SP1 system running on runner +EOF +for repo in ${REPOS}/*; do +echo "RUN { \\" +cat "${repo}" | while read line; do echo " echo '${line//\"/\\\"}' ; \\"; done +echo "} > /etc/zypp/repos.d/$(basename ${repo})" +done >> ${TARGET} + +```