Skip to content

Commit

Permalink
Moving where targetarch is gotten from
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed Aug 14, 2024
1 parent b3131d4 commit 45d5f30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: .
file: src/Teapot.Web/Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: src/Teapot.Web/Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions src/Teapot.Web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS base
ARG TARGETARCH
WORKDIR /app
EXPOSE 80
EXPOSE 443
Expand All @@ -16,9 +15,10 @@ WORKDIR "/src/Teapot.Web"
RUN dotnet build "Teapot.Web.csproj" -c Release -o /app/build

FROM build AS publish
ARG TARGETARCH
RUN dotnet publish "Teapot.Web.csproj" -c Release -o /app/publish -a $TARGETARCH

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Teapot.Web.dll"]
ENTRYPOINT ["dotnet", "Teapot.Web.dll"]

0 comments on commit 45d5f30

Please sign in to comment.