#!ArchExclusiveLine: x86_64
# Define the names/tags of the container
#!BuildTag: suse/dotnet-aspnet:5.0 suse/dotnet-aspnet:5.0.202

FROM suse/sle15:15.3

# Define labels according to https://en.opensuse.org/Building_derived_containers
# labelprefix=com.suse.bci.dotnet.aspnet
PREFIXEDLABEL org.opencontainers.image.title="%OS_PRETTY_NAME% .NET 5.0 aspnet container"
PREFIXEDLABEL org.opencontainers.image.description="Image containing the ASPNET 5.0 runtime based on %OS_PRETTY_NAME%."
PREFIXEDLABEL org.opencontainers.image.version="5.0"
PREFIXEDLABEL org.opencontainers.image.url="https://www.suse.com/products/server/"
PREFIXEDLABEL org.opencontainers.image.created="%BUILDTIME%"
PREFIXEDLABEL org.opencontainers.image.vendor="SUSE LLC"
PREFIXEDLABEL org.opensuse.reference="registry.suse.com/suse/dotnet-aspnet:5.0.202"
PREFIXEDLABEL org.openbuildservice.disturl="%DISTURL%"
# endlabelprefix
LABEL com.suse.techpreview="1"

# The MS GPG keys
COPY microsoft.asc /tmp

# Copy the RPMs previously downloaded via the _service to the container image
COPY dotnet-runtime-5.0.5-x64.rpm /tmp
COPY dotnet-hostfxr-5.0.5-x64.rpm /tmp
COPY dotnet-runtime-deps-5.0.5-sles.12-x64.rpm /tmp
COPY dotnet-host-5.0.5-x64.rpm /tmp
COPY aspnetcore-runtime-5.0.5-x64.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
RUN rpm --import /tmp/microsoft.asc

# Use the package for ICU offered by SLES
RUN zypper --non-interactive install --no-recommends libicu vim

# All required packages for the .NET Runtime
RUN zypper --non-interactive install --no-recommends \
	/tmp/dotnet-host-5.0.5-x64.rpm \
	/tmp/dotnet-hostfxr-5.0.5-x64.rpm \
	/tmp/dotnet-runtime-deps-5.0.5-sles.12-x64.rpm \
	/tmp/dotnet-runtime-5.0.5-x64.rpm \
	/tmp/aspnetcore-runtime-5.0.5-x64.rpm

RUN rm -rf /tmp/* && zypper clean
