Skip to content

Commit

Permalink
Update KubernetesIngress docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminpetit committed Mar 20, 2024
1 parent 1b686b6 commit 2dfab21
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
7 changes: 4 additions & 3 deletions samples/KubernetesIngress.Sample/Combined/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM amd64/buildpack-deps:jammy-curl AS publish
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src
# We need to install the SDK manually because we might target an unreleased SDK
COPY ["global.json", ""]
RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --jsonfile global.json
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
Expand All @@ -28,7 +29,7 @@ WORKDIR /src
COPY . .

WORKDIR /src/samples/KubernetesIngress.Sample/Combined/
RUN /root/.dotnet/dotnet publish -c Release --no-restore -o /app/publish -f net6.0
RUN /root/.dotnet/dotnet publish -c Release --no-restore -o /app/publish -f net8.0

FROM base AS final
WORKDIR /app
Expand Down
7 changes: 4 additions & 3 deletions samples/KubernetesIngress.Sample/Ingress/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM amd64/buildpack-deps:jammy-curl AS publish
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src
# We need to install the SDK manually because we might target an unreleased SDK
COPY ["global.json", ""]
RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --jsonfile global.json
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
Expand All @@ -28,7 +29,7 @@ WORKDIR /src
COPY . .

WORKDIR /src/samples/KubernetesIngress.Sample/Ingress/
RUN /root/.dotnet/dotnet publish -c Release --no-restore -o /app/publish -f net6.0
RUN /root/.dotnet/dotnet publish -c Release --no-restore -o /app/publish -f net8.0

FROM base AS final
WORKDIR /app
Expand Down
7 changes: 4 additions & 3 deletions samples/KubernetesIngress.Sample/Monitor/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM amd64/buildpack-deps:jammy-curl AS publish
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src
# We need to install the SDK manually because we might target an unreleased SDK
COPY ["global.json", ""]
RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --jsonfile global.json
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
Expand All @@ -28,7 +29,7 @@ WORKDIR /src
COPY . .

WORKDIR /src/samples/KubernetesIngress.Sample/Monitor/
RUN /root/.dotnet/dotnet publish -c Release --no-restore -o /app/publish -f net6.0
RUN /root/.dotnet/dotnet publish -c Release --no-restore -o /app/publish -f net8.0

FROM base AS final
WORKDIR /app
Expand Down
5 changes: 3 additions & 2 deletions samples/KubernetesIngress.Sample/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM amd64/buildpack-deps:jammy-curl AS publish
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish
WORKDIR /src
# We need to install the SDK manually because we might target an unreleased SDK
COPY ["global.json", ""]
RUN curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --jsonfile global.json
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT 1
Expand Down

0 comments on commit 2dfab21

Please sign in to comment.