diff --git a/Dockerfile b/Dockerfile index c25ec73..8b6c9ba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 ****" && \ diff --git a/docker-publish.ps1 b/docker-publish.ps1 index ef298c3..3706da9 100755 --- a/docker-publish.ps1 +++ b/docker-publish.ps1 @@ -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