-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Justin Anderson <jander-msft@users.noreply.github.com> Co-authored-by: Logan Bussell <loganbussell@microsoft.com> Co-authored-by: Damian Edwards <damian@damianedwards.com> Co-authored-by: Matt Thalman <mthalman@microsoft.com>
- Loading branch information
1 parent
7c2fc5f
commit c09ce8b
Showing
102 changed files
with
1,417 additions
and
545 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
# Learn about building .NET container images: | ||
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build | ||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG TARGETARCH | ||
WORKDIR /source | ||
|
||
# copy csproj and restore as distinct layers | ||
COPY aspnetapp/*.csproj . | ||
RUN dotnet restore --use-current-runtime | ||
RUN dotnet restore -a $TARGETARCH | ||
|
||
# copy everything else and build app | ||
# copy and publish app and libraries | ||
COPY aspnetapp/. . | ||
RUN dotnet publish --use-current-runtime --self-contained false --no-restore -o /app | ||
RUN dotnet publish -a $TARGETARCH --no-restore -o /app | ||
|
||
|
||
# final stage/image | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0 | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 | ||
WORKDIR /app | ||
COPY --from=build /app . | ||
ENTRYPOINT ["dotnet", "aspnetapp.dll"] | ||
USER $APP_UID | ||
ENTRYPOINT ["./aspnetapp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
# Learn about building .NET container images: | ||
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md | ||
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build | ||
|
||
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build | ||
ARG TARGETARCH | ||
WORKDIR /source | ||
|
||
# copy csproj and restore as distinct layers | ||
COPY aspnetapp/*.csproj . | ||
RUN dotnet restore --use-current-runtime | ||
# optimize | ||
RUN --mount=type=bind,source=aspnetapp/aspnetapp.csproj,target=aspnetapp.csproj \ | ||
--mount=type=cache,target=/root/.nuget/ \ | ||
dotnet restore -a $TARGETARCH | ||
|
||
# copy everything else and build app | ||
# copy and publish app and libraries | ||
COPY aspnetapp/. . | ||
RUN dotnet publish --use-current-runtime --self-contained false --no-restore -o /app | ||
RUN dotnet publish -a $TARGETARCH --no-restore -o /app | ||
|
||
|
||
# Enable globalization and time zones: | ||
# https://github.com/dotnet/dotnet-docker/blob/main/samples/enable-globalization.md | ||
# final stage/image | ||
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine | ||
WORKDIR /app | ||
COPY --from=build /app . | ||
USER $APP_UID | ||
ENTRYPOINT ["./aspnetapp"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.