-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.build
More file actions
27 lines (21 loc) · 1.18 KB
/
Copy pathDockerfile.build
File metadata and controls
27 lines (21 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
# Clone repos as siblings (the expected layout), pinned to a known-good release
RUN git clone --depth 1 --branch dns-server-v14.3.0 https://github.com/TechnitiumSoftware/TechnitiumLibrary.git /src/TechnitiumLibrary && \
git clone --depth 1 --branch v14.3.0 https://github.com/TechnitiumSoftware/DnsServer.git /src/DnsServer
# Build only the TechnitiumLibrary projects we need (Firewall is Windows-only)
RUN dotnet build /src/TechnitiumLibrary/TechnitiumLibrary/TechnitiumLibrary.csproj -c Release && \
dotnet build /src/TechnitiumLibrary/TechnitiumLibrary.Net/TechnitiumLibrary.Net.csproj -c Release
# DLLs are output to /src/TechnitiumLibrary/bin/ by the project's OutputPath
# Build DnsServerCore.ApplicationCommon
WORKDIR /src/DnsServer/DnsServerCore.ApplicationCommon
RUN dotnet build -c Release
# Copy our app source and build it
WORKDIR /src/app
COPY src/ContentFilter/ ./
RUN dotnet restore
RUN dotnet publish -c Release -o /out --no-restore
FROM build AS package
RUN apt-get update -qq && apt-get install -y -qq zip > /dev/null 2>&1
RUN cd /out && zip -r /ContentFilter.zip .
FROM scratch AS export
COPY --from=package /ContentFilter.zip /