From b33115579b7e3e3fd4262cf75551a935c627a031 Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 21 Nov 2023 12:58:44 -0800 Subject: [PATCH] Fix docker build --- .github/workflows/preview_ci.yml | 2 +- .github/workflows/release_ci.yml | 2 +- Dockerfile | 4 ++-- Dockerfile-CI | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/preview_ci.yml b/.github/workflows/preview_ci.yml index 504b6e404cf..88e1cdd08ea 100644 --- a/.github/workflows/preview_ci.yml +++ b/.github/workflows/preview_ci.yml @@ -67,7 +67,7 @@ jobs: Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false $output = [System.IO.Path]::GetFullPath("./.build/release") dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0 - docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:dev . + docker build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:dev . docker push orchardproject/orchardcore-cms-linux:dev - name: Deploy preview docker image for windows if: matrix.os == 'windows-latest' diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index 0bb7c250211..a52488b883c 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -78,7 +78,7 @@ jobs: Get-ChildItem ./src/OrchardCore.Cms.Web/App_Data_Tests -Recurse | Remove-Item -Recurse -Confirm:$false $output = [System.IO.Path]::GetFullPath("./.build/release") dotnet publish -c Release --property:PublishDir=$output --no-build --framework net8.0 - docker build -f Dockerfile-CI -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} . + docker build -f Dockerfile-CI --platform=linux/amd64 -t orchardproject/orchardcore-cms-linux:latest -t orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }} . docker push orchardproject/orchardcore-cms-linux:latest docker push "orchardproject/orchardcore-cms-linux:${{ steps.get_version.outputs.VERSION }}" - name: Deploy preview docker image for windows diff --git a/Dockerfile b/Dockerfile index 0a1bde8436d..85b899d1c23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG TARGETOS=linux -FROM --platform=$TARGETOS golang:alpine AS build +FROM --platform=$BUILDPLATFORM golang:alpine AS build +ARG TARGETOS FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env LABEL stage=build-env diff --git a/Dockerfile-CI b/Dockerfile-CI index 786af3c0312..f118690e976 100644 --- a/Dockerfile-CI +++ b/Dockerfile-CI @@ -1,7 +1,7 @@ # This Docker file is intended for the CI # A prerequisite is a published application in the .build/release -ARG TARGETOS=linux -FROM --platform=$TARGETOS golang:alpine AS build +FROM --platform=$BUILDPLATFORM golang:alpine AS build +ARG TARGETOS FROM mcr.microsoft.com/dotnet/aspnet:8.0-nanoserver-1809 AS build_windows FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS build_linux