Skip to content

Commit

Permalink
More dockerfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
helto4real committed Dec 12, 2020
1 parent 804d94c commit 8e4b437
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
12 changes: 5 additions & 7 deletions Docker/build_dotnet.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash
ARCH=$(uname -m)

echo "UNAME IS!!!!: $ARCH"

if [ $ARCH == "armv7l" ]; then
echo "TARGET PLATFORM: $TARGETPLATFORM"
if [ $TARGETPLATFORM == "linux/arm/v7" ]; then
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-arm" -o "/daemon"
elif [ $ARCH == "aarch64" ]; then
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-arm" -o "/daemon"
elif [ $ARCH == "x86_64" ]; then
elif [ $TARGETPLATFORM == "linux/arm64" ]; then
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-arm64" -o "/daemon"
elif [ $TARGETPLATFORM == "linux/amd64" ]; then
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-x64" -o "/daemon"
else
echo 'NOT VALID BUILD'; exit 1;
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
# Build the NetDaemon Admin with build container
FROM ludeeus/container:frontend as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM

RUN echo "I am running on $BUILDPLATFORM" > /log
RUN echo "building for $TARGETPLATFORM" > /log


RUN \
apk add make \
\
Expand All @@ -22,6 +15,13 @@ RUN \
# Pre-build .NET NetDaemon core project
FROM mcr.microsoft.com/dotnet/sdk:5.0.101-buster-slim-amd64 as netbuilder

ARG TARGETPLATFORM
ARG BUILDPLATFORM

RUN echo "I am running on $BUILDPLATFORM"
RUN echo "building for $TARGETPLATFORM"

RUN export TARGETPLATFORM=$TARGETPLATFORM
# Copy the source to docker container
COPY ./src /usr/src
COPY ./Docker/build_dotnet.sh /build.sh
Expand Down

0 comments on commit 8e4b437

Please sign in to comment.