Skip to content

Commit ef3496f

Browse files
committed
feat: updated dockerfile resolving issues on docker build for AMD
1 parent aec2265 commit ef3496f

File tree

1 file changed

+8
-6
lines changed
  • Rsk.Samples.IdentityServer.AdminUiIntegration

1 file changed

+8
-6
lines changed

Rsk.Samples.IdentityServer.AdminUiIntegration/Dockerfile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Stage 1 - Build
2-
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
2+
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
3+
ARG TARGETARCH
4+
35
WORKDIR /app
46

57
# packages installed
@@ -8,24 +10,24 @@ RUN apk update && \
810

911
# Copy csproj and restore as distinct layers
1012
COPY *.csproj .
11-
RUN dotnet restore
13+
RUN dotnet restore -a $TARGETARCH
1214

1315
# Copy everything else and build
1416
COPY . .
15-
RUN dotnet publish -c Release -o out
17+
RUN dotnet publish -a $TARGETARCH -o out
1618

1719
# Stage 2 - Runtime
18-
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS runtime
20+
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS runtime
1921

2022
# Ensuring latest openssl is installed as the one in base
2123
# is out of date and vulnerable
2224
RUN apk update && \
2325
apk upgrade && \
2426
apk upgrade openssl
2527

26-
ENV ASPNETCORE_ENVIRONMENT Production
28+
ENV ASPNETCORE_ENVIRONMENT=Production
2729
ENV ASPNETCORE_HTTP_PORT=5003
28-
ENV ASPNETCORE_URLS http://*:5003
30+
ENV ASPNETCORE_URLS=http://*:5003
2931
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
3032

3133
EXPOSE 5003

0 commit comments

Comments
 (0)