Fixed Dockerfile to build the ARM64 build correctly.
This commit is contained in:
parent
a3ea5c61f2
commit
f63758521a
2 changed files with 17 additions and 12 deletions
|
|
@ -33,11 +33,14 @@ RUN \
|
||||||
git clone https://github.com/rogerfar/rdt-client.git . && \
|
git clone https://github.com/rogerfar/rdt-client.git . && \
|
||||||
echo "**** Building Source Code for $TARGETPLATFORM on $BUILDPLATFORM ****" && \
|
echo "**** Building Source Code for $TARGETPLATFORM on $BUILDPLATFORM ****" && \
|
||||||
cd server && \
|
cd server && \
|
||||||
if [ "$TARGETPLATFORM" = "linux/arm/v7" -o "$TARGETPLATFORM" = "linux/arm64" ] ; then \
|
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then \
|
||||||
echo "**** Building $TARGETPLATFORM arm version" && \
|
echo "**** Building $TARGETPLATFORM arm v7 version" && \
|
||||||
dotnet restore -r linux-arm RdtClient.sln && dotnet publish -r linux-arm -c Release -o out ; \
|
dotnet restore -r linux-arm RdtClient.sln && dotnet publish -r linux-arm -c Release -o out ; \
|
||||||
|
elif [ "$TARGETPLATFORM" = "linux/arm/v8"] ; then \
|
||||||
|
echo "**** Building $TARGETPLATFORM arm v8 version" && \
|
||||||
|
dotnet restore -r linux-arm64 RdtClient.sln && dotnet publish -r linux-arm64 -c Release -o out ; \
|
||||||
else \
|
else \
|
||||||
echo "**** Building $TARGETPLATFORM x86 version" && \
|
echo "**** Building $TARGETPLATFORM x64 version" && \
|
||||||
dotnet restore RdtClient.sln && dotnet publish -c Release -o out ; \
|
dotnet restore RdtClient.sln && dotnet publish -c Release -o out ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,10 +41,12 @@ $imageName = "$($DockerAccount)/rdtclient"
|
||||||
|
|
||||||
$dockerArgs = @( "buildx", "build", "--push", "--platform", $Platforms, "--tag", "$($imageName):latest", "." )
|
$dockerArgs = @( "buildx", "build", "--push", "--platform", $Platforms, "--tag", "$($imageName):latest", "." )
|
||||||
|
|
||||||
if (![string]::IsNullOrEmpty($Version)) {
|
if ([string]::IsNullOrEmpty($Version)) {
|
||||||
$dockerArgs += @("--tag", "$($imageName):$($Version)" )
|
$Version = (Get-Content "package.json" | ConvertFrom-Json).version
|
||||||
$dockerApps += @("--build-arg", "VERSION=$($Version)" )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dockerArgs += @("--tag", "$($imageName):$($Version)" )
|
||||||
|
$dockerApps += @("--build-arg", "VERSION=$($Version)" )
|
||||||
|
|
||||||
Write-Host "Generating docker image $imageName for $Platforms"
|
Write-Host "Generating docker image $imageName for $Platforms"
|
||||||
& docker $dockerArgs
|
& docker $dockerArgs
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue