Skip to content

Commit 8e4b437

Browse files
committed
More dockerfixes
1 parent 804d94c commit 8e4b437

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

Docker/build_dotnet.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/bin/bash
22
ARCH=$(uname -m)
3-
4-
echo "UNAME IS!!!!: $ARCH"
5-
6-
if [ $ARCH == "armv7l" ]; then
3+
echo "TARGET PLATFORM: $TARGETPLATFORM"
4+
if [ $TARGETPLATFORM == "linux/arm/v7" ]; then
75
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-arm" -o "/daemon"
8-
elif [ $ARCH == "aarch64" ]; then
9-
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-arm" -o "/daemon"
10-
elif [ $ARCH == "x86_64" ]; then
6+
elif [ $TARGETPLATFORM == "linux/arm64" ]; then
7+
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-arm64" -o "/daemon"
8+
elif [ $TARGETPLATFORM == "linux/amd64" ]; then
119
dotnet publish /usr/src/Service/Service.csproj -v q -c Release -r "linux-x64" -o "/daemon"
1210
else
1311
echo 'NOT VALID BUILD'; exit 1;

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# Build the NetDaemon Admin with build container
22
FROM ludeeus/container:frontend as builder
33

4-
ARG TARGETPLATFORM
5-
ARG BUILDPLATFORM
6-
7-
RUN echo "I am running on $BUILDPLATFORM" > /log
8-
RUN echo "building for $TARGETPLATFORM" > /log
9-
10-
114
RUN \
125
apk add make \
136
\
@@ -22,6 +15,13 @@ RUN \
2215
# Pre-build .NET NetDaemon core project
2316
FROM mcr.microsoft.com/dotnet/sdk:5.0.101-buster-slim-amd64 as netbuilder
2417

18+
ARG TARGETPLATFORM
19+
ARG BUILDPLATFORM
20+
21+
RUN echo "I am running on $BUILDPLATFORM"
22+
RUN echo "building for $TARGETPLATFORM"
23+
24+
RUN export TARGETPLATFORM=$TARGETPLATFORM
2525
# Copy the source to docker container
2626
COPY ./src /usr/src
2727
COPY ./Docker/build_dotnet.sh /build.sh

0 commit comments

Comments
 (0)