Files
dotnet-runtime/eng/docker/libraries-sdk.linux.Dockerfile
Anton Firszov 85642f8147 Build HttpStress and SslStress with live-built runtime using current TFM (#61689)
This PR changes both local (non-containerized) and containerized stress builds to build against the live-built runtime with the help of targetingpacks.targets.
2021-11-30 18:16:30 +01:00

50 lines
1.9 KiB
Docker

# Builds and copies library artifacts into target dotnet sdk image
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-f39df28-20191023143754
ARG SDK_BASE_IMAGE=mcr.microsoft.com/dotnet/nightly/sdk:6.0-bullseye-slim
FROM $BUILD_BASE_IMAGE as corefxbuild
ARG CONFIGURATION=Release
WORKDIR /repo
COPY . .
RUN ./build.sh clr+libs -runtimeconfiguration Release -configuration $CONFIGURATION -ci
FROM $SDK_BASE_IMAGE as target
ARG VERSION=7.0
ARG CONFIGURATION=Release
ENV _DOTNET_INSTALL_CHANNEL="$VERSION.1xx"
# Install latest daily SDK:
RUN wget https://dot.net/v1/dotnet-install.sh
RUN bash ./dotnet-install.sh --channel $_DOTNET_INSTALL_CHANNEL --quality daily --install-dir /usr/share/dotnet
# Collect the following artifacts under /live-runtime-artifacts,
# so projects can build and test against the live-built runtime:
# 1. Reference assembly pack (microsoft.netcore.app.ref)
# 2. Runtime pack (microsoft.netcore.app.runtime.linux-x64)
# 3. targetingpacks.targets, so stress test builds can target the live-built runtime instead of the one in the pre-installed SDK
# 4. testhost
COPY --from=corefxbuild \
/repo/artifacts/bin/microsoft.netcore.app.ref \
/live-runtime-artifacts/microsoft.netcore.app.ref
COPY --from=corefxbuild \
/repo/artifacts/bin/microsoft.netcore.app.runtime.linux-x64 \
/live-runtime-artifacts/microsoft.netcore.app.runtime.linux-x64
COPY --from=corefxbuild \
/repo/eng/targetingpacks.targets \
/live-runtime-artifacts/targetingpacks.targets
COPY --from=corefxbuild \
/repo/artifacts/bin/testhost \
/live-runtime-artifacts/testhost
# Add AspNetCore bits to testhost:
ENV _ASPNETCORE_SOURCE="/usr/share/dotnet/shared/Microsoft.AspNetCore.App/$VERSION*"
ENV _ASPNETCORE_DEST="/live-runtime-artifacts/testhost/net$VERSION-Linux-$CONFIGURATION-x64/shared/Microsoft.AspNetCore.App"
RUN mkdir -p $_ASPNETCORE_DEST
RUN cp -r $_ASPNETCORE_SOURCE $_ASPNETCORE_DEST