File Dockerfile of Package dotnet-runtime-9.0

# SPDX-License-Identifier: MIT

#     Copyright (c) 2025 SUSE LLC

# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon.

# The content of THIS FILE IS AUTOGENERATED and should not be manually modified.
# It is maintained by the BCI team and generated by
# https://github.com/SUSE/BCI-dockerfile-generator

# Please submit bugfixes or comments via https://bugs.opensuse.org/
# You can contact the BCI team via https://github.com/SUSE/bci/discussions

#!UseOBSRepositories
#!ExclusiveArch: x86_64
#!BuildTag: bci/dotnet-runtime:9.0.10-%RELEASE%
#!BuildTag: bci/dotnet-runtime:9.0.10
#!BuildTag: bci/dotnet-runtime:9.0
#!BuildTag: bci/dotnet-runtime:latest
#!BuildName: bci-dotnet-runtime-9.0
#!BuildVersion: 15.7.9.0
#!BuildRelease: 20
FROM registry.suse.com/bci/bci-base:15.7



# set the day of last password change to empty
RUN set -euo pipefail; sed -i 's/^\([^:]*:[^:]*:\)[^:]*\(:.*\)$/\1\2/' /etc/shadow

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.bci.dotnet.runtime
LABEL org.opencontainers.image.authors="https://github.com/SUSE/bci/discussions"
LABEL org.opencontainers.image.title="SLE BCI .NET Runtime 9.0"
LABEL org.opencontainers.image.description="The .NET Runtime 9.0 based on the SLE Base Container Image. The .NET packages contained in this image come from a 3rd-party repository http://packages.microsoft.com. You can find the respective source code in https://github.com/dotnet. SUSE doesn't provide any support or warranties."
LABEL org.opencontainers.image.version="9.0.10"
LABEL org.opencontainers.image.url="https://www.suse.com/products/base-container-images/"
LABEL org.opencontainers.image.created="%BUILDTIME%"
LABEL org.opencontainers.image.vendor="SUSE LLC"
LABEL org.opencontainers.image.source="%SOURCEURL%"
LABEL org.opencontainers.image.ref.name="9.0.10-%RELEASE%"
LABEL org.opensuse.reference="registry.suse.com/bci/dotnet-runtime:9.0.10-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="techpreview"
LABEL com.suse.supportlevel.until="2026-05-12"
LABEL com.suse.eula="sle-bci"
LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle#suse-linux-enterprise-server-15"
LABEL com.suse.release-stage="released"
# endlabelprefix
LABEL org.opencontainers.image.base.name="%BASE_REFNAME%"
LABEL org.opencontainers.image.base.digest="%BASE_DIGEST%"
LABEL io.artifacthub.package.readme-url="%SOURCEURL_WITH(README.md)%"


RUN mkdir -p /tmp/

#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-host-9.0.10-1.x86_64.rpm sha256:a56c06eebbe664d295de06db9b8071f7d19bd272e27b7d0c436a0c4f7c995a18
COPY dotnet-host-9.0.10-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-hostfxr-9.0-9.0.10-1.x86_64.rpm sha256:9e0a9d00f886fd655419c511b2ef9a9bd1995b282d119339dd38bb1062a29b09
COPY dotnet-hostfxr-9.0-9.0.10-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-runtime-deps-9.0-9.0.10-1.x86_64.rpm sha256:56918b6c1ad18126e041c531011d3079773b81afcb746e8934336b0e64b8041e
COPY dotnet-runtime-deps-9.0-9.0.10-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-runtime-9.0-9.0.10-1.x86_64.rpm sha256:517794e088d76fa41f10ed90083a7cbf5e588a78097a1607033d0f5ce787ec12
COPY dotnet-runtime-9.0-9.0.10-1.x86_64.rpm /tmp/


# Workaround for https://github.com/openSUSE/obs-build/issues/487
RUN zypper --non-interactive install --no-recommends coreutils sles-release

# Importing MS GPG keys
COPY microsoft.asc /tmp
RUN rpm --import /tmp/microsoft.asc

RUN zypper --non-interactive install --no-recommends libicu libopenssl1_1 /tmp/*rpm

COPY prod.repo /etc/zypp/repos.d/microsoft-dotnet-prod.repo
COPY dotnet-host.check /etc/zypp/systemCheck.d/dotnet-host.check

RUN rm -rf /tmp/* && zypper clean -a && rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}; \
    rm -rf {/target,}/run/*; \
    rm -f {/target,}/etc/{shadow-,group-,passwd-,.pwd.lock}; \
    rm -f {/target,}/usr/lib/sysimage/rpm/.rpm.lock; \
    rm -f {/target,}/var/cache/ldconfig/aux-cache; \
    command -v zypper >/dev/null 2>&1 || rm -f /var/lib/zypp/AutoInstalled



ENV APP_UID=1654 ASPNETCORE_HTTP_PORTS=8080 DOTNET_RUNNING_IN_CONTAINER=true
ENV DOTNET_VERSION=9.0.10
RUN useradd --uid=$APP_UID -U -d /app -G '' -ms /bin/bash app
WORKDIR /app
EXPOSE 8080
openSUSE Build Service is sponsored by