# SPDX-License-Identifier: MIT

#     Copyright (c) 2024 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

#!ExclusiveArch: x86_64
#!BuildTag: bci/dotnet-runtime:8.0
#!BuildTag: bci/dotnet-runtime:8.0-%RELEASE%
#!BuildTag: bci/dotnet-runtime:8.0.8
#!BuildTag: bci/dotnet-runtime:8.0.8-%RELEASE%
#!BuildTag: bci/dotnet-runtime:latest
#!BuildName: bci-dotnet-runtime-8.0
#!BuildVersion: 15.6.8.0
#!BuildRelease: 20
FROM bci/bci-base:15.6



# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.bci.dotnet.runtime
LABEL org.opencontainers.image.authors="SUSE LLC (https://www.suse.com/)"
LABEL org.opencontainers.image.title="SLE BCI .NET Runtime 8.0"
LABEL org.opencontainers.image.description="The .NET Runtime 8.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="8.0"
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="8.0-%RELEASE%"
LABEL org.opensuse.reference="registry.suse.com/bci/dotnet-runtime:8.0-%RELEASE%"
LABEL org.openbuildservice.disturl="%DISTURL%"
LABEL com.suse.supportlevel="techpreview"
LABEL com.suse.supportlevel.until="2026-11-10"
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 io.artifacthub.package.readme-url="%SOURCEURL%/README.md"


RUN mkdir -p /tmp/

#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-host-8.0.8-1.x86_64.rpm
COPY dotnet-host-8.0.8-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-hostfxr-8.0-8.0.8-1.x86_64.rpm
COPY dotnet-hostfxr-8.0-8.0.8-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-runtime-deps-8.0-8.0.8-1.x86_64.rpm
COPY dotnet-runtime-deps-8.0-8.0.8-1.x86_64.rpm /tmp/
#!RemoteAssetUrl: https://packages.microsoft.com/sles/15/prod/Packages/d/dotnet-runtime-8.0-8.0.8-1.x86_64.rpm
COPY dotnet-runtime-8.0-8.0.8-1.x86_64.rpm /tmp/


# Workaround for https://github.com/openSUSE/obs-build/issues/487
RUN zypper --non-interactive install --no-recommends 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 /var/log/{lastlog,tallylog,zypper.log,zypp/history,YaST2}


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