Fixed Dockerfile to build the ARM64 build correctly.

This commit is contained in:
Roger Far 2021-06-05 14:56:33 -06:00
parent a3ea5c61f2
commit f63758521a
2 changed files with 17 additions and 12 deletions

View file

@ -9,10 +9,10 @@ RUN mkdir /appclient
WORKDIR /appclient
RUN \
echo "**** Cloning Source Code ****" && \
echo "**** Cloning Source Code ****" && \
git clone https://github.com/rogerfar/rdt-client.git . && \
cd client && \
echo "**** Building Code ****" && \
echo "**** Building Code ****" && \
npm ci && \
npx ng build --prod --output-path=out
@ -29,15 +29,18 @@ RUN mkdir /appserver
WORKDIR /appserver
RUN \
echo "**** Cloning Source Code ****" && \
echo "**** Cloning Source Code ****" && \
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 && \
if [ "$TARGETPLATFORM" = "linux/arm/v7" -o "$TARGETPLATFORM" = "linux/arm64" ] ; then \
echo "**** Building $TARGETPLATFORM arm version" && \
if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then \
echo "**** Building $TARGETPLATFORM arm v7 version" && \
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 \
echo "**** Building $TARGETPLATFORM x86 version" && \
echo "**** Building $TARGETPLATFORM x64 version" && \
dotnet restore RdtClient.sln && dotnet publish -c Release -o out ; \
fi
@ -61,9 +64,9 @@ ENV RDTCLIENT_BRANCH="main"
RUN \
mkdir -p /data/downloads /data/db || true && \
echo "**** Updating package information ****" && \
echo "**** Updating package information ****" && \
apt-get update -y -qq && \
echo "**** Install pre-reqs ****" && \
echo "**** Install pre-reqs ****" && \
apt-get install -y -qq wget dos2unix && \
apt-get install -y libc6 libgcc1 libgssapi-krb5-2 libssl1.1 libstdc++6 zlib1g libicu66 && \
echo "**** Installing dotnet ****" && \

View file

@ -41,10 +41,12 @@ $imageName = "$($DockerAccount)/rdtclient"
$dockerArgs = @( "buildx", "build", "--push", "--platform", $Platforms, "--tag", "$($imageName):latest", "." )
if (![string]::IsNullOrEmpty($Version)) {
$dockerArgs += @("--tag", "$($imageName):$($Version)" )
$dockerApps += @("--build-arg", "VERSION=$($Version)" )
if ([string]::IsNullOrEmpty($Version)) {
$Version = (Get-Content "package.json" | ConvertFrom-Json).version
}
$dockerArgs += @("--tag", "$($imageName):$($Version)" )
$dockerApps += @("--build-arg", "VERSION=$($Version)" )
Write-Host "Generating docker image $imageName for $Platforms"
& docker $dockerArgs