Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
warning-explosive committed Feb 7, 2023
1 parent 0541d0f commit d9d442a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile.webtest
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ ARG SDK_ARCH=arm64v8
ARG DOT_NET_VERSION=7.0

FROM mcr.microsoft.com/dotnet/sdk:${DOT_NET_VERSION}-alpine-${SDK_ARCH} AS builder
# TARGETARCH = arm64 | x64 | amd64
ARG TARGETARCH
RUN arch=$TARGETARCH \
&& if [ "$TARGETARCH" = "amd64" ]; then arch="x64"; fi \
&& echo $arch > /tmp/arch
ENV NUGET_XMLDOC_MODE=none
WORKDIR /build
COPY . .
RUN dotnet restore Tests/Test.WebApplication/Test.WebApplication.csproj --no-cache -v:minimal
RUN dotnet build Tests/Test.WebApplication/Test.WebApplication.csproj -c Debug -o out --no-cache --no-restore -v:minimal
RUN dotnet restore Tests/Test.WebApplication/Test.WebApplication.csproj -r linux-$(cat /tmp/arch) --no-cache -v:minimal
RUN dotnet build Tests/Test.WebApplication/Test.WebApplication.csproj -c Debug -o out -r linux-$(cat /tmp/arch) --no-self-contained --no-cache --no-restore -v:minimal

FROM mcr.microsoft.com/dotnet/aspnet:${DOT_NET_VERSION}-alpine
WORKDIR /app
Expand All @@ -16,4 +21,4 @@ COPY --from=builder /build/Tests/Test.WebApplication/ComposeSettings /app/Settin
COPY --from=builder /build/Tests/Test.WebApplication/Test.WebApplication.csproj /app/Test.WebApplication.csproj
ENTRYPOINT ["dotnet", "SpaceEngineers.Core.Test.WebApplication.dll"]

# docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.webtest .
# docker buildx build --platform linux/amd64,linux/arm64 -f Dockerfile.webtest .
8 changes: 8 additions & 0 deletions Tests/Test.WebApplication/Test.WebApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.4.0" />
<PackageReference Include="System.Collections" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.Debug" Version="4.3.0" />
<PackageReference Include="System.IO" Version="4.3.0" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.0" />
<PackageReference Include="System.Runtime.Handles" Version="4.3.0" />
<PackageReference Include="System.Runtime.InteropServices" Version="4.3.0" />
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Endpoints\AuthEndpoint.Host\AuthEndpoint.Host.csproj" />
Expand Down

0 comments on commit d9d442a

Please sign in to comment.