Skip to content

Commit

Permalink
Fix multi-arch Docker image build.
Browse files Browse the repository at this point in the history
  • Loading branch information
aholmes committed Jan 31, 2024
1 parent 29f5d73 commit dab4ade
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
WORKDIR /app
Expand All @@ -8,7 +9,7 @@ RUN dotnet restore -a $TARGETARCH

RUN dotnet publish -a $TARGETARCH --no-restore -c Release -o out

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .

Expand Down
2 changes: 2 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker buildx build --pull --push --platform linux/amd64,linux/arm64 --no-cache -t #aholmes0/hubitat2prom:v1.2.5 -t aholmes0/hubitat2prom:latest .

0 comments on commit dab4ade

Please sign in to comment.