Skip to content

Commit

Permalink
Removed multi-SDK targetting for Common.
Browse files Browse the repository at this point in the history
  • Loading branch information
GinoCanessa committed Aug 30, 2024
1 parent cf64b90 commit 3718d0c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 30 deletions.
59 changes: 30 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,43 +1,44 @@
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
ARG TARGETPLATFORM
ARG BUILDPLATFORM
#RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log
WORKDIR /app

# Copy everything else and build
COPY . ./

# Build with platform-specific .Net RID
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
dotnet restore src/fhir-candle/fhir-candle.csproj --arch x64; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch x64; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
dotnet restore src/fhir-candle/fhir-candle.csproj --arch arm64; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch arm64; \
elif [ "$TARGETPLATFORM" = "windows/x64" ]; then \
dotnet restore src/fhir-candle/fhir-candle.csproj --arch x64; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch x64; \
elif [ "$TARGETPLATFORM" = "windows/arm64" ]; then \
dotnet restore src/fhir-candle/fhir-candle.csproj --arch arm64; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch arm64; \
elif [ "$TARGETPLATFORM" = "darwin/x64" ]; then \
dotnet restore src/fhir-candle/fhir-candle.csproj --arch x64; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch x64; \
elif [ "$TARGETPLATFORM" = "darwin/arm64" ]; then \
dotnet restore src/fhir-candle/fhir-candle.csproj --arch arm64; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch arm64; \
else \
#echo "Unsupported architecture: $TARGETPLATFORM"; \
#exit 1; \
dotnet restore src/fhir-candle/fhir-candle.csproj; \
dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0; \
fi;
#
## Build with platform-specific .Net RID
#RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
#dotnet restore src/fhir-candle/fhir-candle.csproj --arch x64; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch x64; \
#elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
#dotnet restore src/fhir-candle/fhir-candle.csproj --arch arm64; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch arm64; \
#elif [ "$TARGETPLATFORM" = "windows/x64" ]; then \
#dotnet restore src/fhir-candle/fhir-candle.csproj --arch x64; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch x64; \
#elif [ "$TARGETPLATFORM" = "windows/arm64" ]; then \
#dotnet restore src/fhir-candle/fhir-candle.csproj --arch arm64; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch arm64; \
#elif [ "$TARGETPLATFORM" = "darwin/x64" ]; then \
#dotnet restore src/fhir-candle/fhir-candle.csproj --arch x64; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch x64; \
#elif [ "$TARGETPLATFORM" = "darwin/arm64" ]; then \
#dotnet restore src/fhir-candle/fhir-candle.csproj --arch arm64; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0 --arch arm64; \
#else \
##echo "Unsupported architecture: $TARGETPLATFORM"; \
##exit 1; \
#dotnet restore src/fhir-candle/fhir-candle.csproj; \
#dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0; \
#fi;

#RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out --framework net8.0;
#RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out
RUN dotnet restore src/fhir-candle/fhir-candle.csproj
RUN dotnet publish src/fhir-candle/fhir-candle.csproj -c Release -o out

# Build runtime image
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "fhir-candle.dll"]
Expand Down
3 changes: 2 additions & 1 deletion src/FhirStore.Common/FhirCandle.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

<PropertyGroup>
<LangVersion>12.0</LangVersion>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<!--<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>-->
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>FhirCandle</RootNamespace>
Expand Down

0 comments on commit 3718d0c

Please sign in to comment.