# 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-aspnet:9.0.3-%RELEASE%
#!BuildTag: bci/dotnet-aspnet:9.0.3
#!BuildTag: bci/dotnet-aspnet:9.0
#!BuildTag: bci/dotnet-aspnet:latest
#!BuildName: bci-dotnet-aspnet-9.0
#!BuildVersion: 15.6.9.0
#!BuildRelease: 1
FROM registry.suse.com/bci/bci-base:15.6



# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.bci.dotnet.aspnet
LABEL org.opencontainers.image.authors="https://github.com/SUSE/bci/discussions"
LABEL org.opencontainers.image.title="SLE BCI ASP.NET Core Runtime 9.0"
LABEL org.opencontainers.image.description="The ASP.NET Core 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.3"
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.3-%RELEASE%"
LABEL org.opensuse.reference="registry.suse.com/bci/dotnet-aspnet:9.0.3-%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%/README.md"


RUN mkdir -p /tmp/

#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-host-9.0.3-1.x86_64.rpm
COPY dotnet-host-9.0.3-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-hostfxr-9.0-9.0.3-1.x86_64.rpm
COPY dotnet-hostfxr-9.0-9.0.3-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-runtime-deps-9.0-9.0.3-1.x86_64.rpm
COPY dotnet-runtime-deps-9.0-9.0.3-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-runtime-9.0-9.0.3-1.x86_64.rpm
COPY dotnet-runtime-9.0-9.0.3-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/a/aspnetcore-runtime-9.0-9.0.3-1.x86_64.rpm
COPY aspnetcore-runtime-9.0-9.0.3-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 && rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2}


ENV APP_UID=1654 ASPNETCORE_HTTP_PORTS=8080 DOTNET_RUNNING_IN_CONTAINER=true
ENV DOTNET_VERSION=9.0.3
RUN useradd --uid=$APP_UID -U -d /app -G '' -ms /bin/bash app
WORKDIR /app
EXPOSE 8080
