-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
511 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 as builder | ||
# Build args | ||
ARG VERSION | ||
ARG APP_INSIGHTS_ID | ||
|
||
ENV GOOS=windows | ||
ENV GOARCH=amd64 | ||
|
||
WORKDIR /usr/src/retina | ||
# Copy the source | ||
COPY . . | ||
|
||
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/ | ||
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/ | ||
|
||
# Copy into final image | ||
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as final | ||
COPY --from=builder /usr/src/retina/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml | ||
COPY --from=builder /usr/src/retina/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 | ||
COPY --from=builder /usr/bin/controller.exe controller.exe | ||
COPY --from=builder /usr/bin/captureworkload.exe captureworkload.exe | ||
|
||
ADD https://github.com/microsoft/etl2pcapng/releases/download/v1.10.0/etl2pcapng.exe /etl2pcapng.exe | ||
|
||
CMD ["controller.exe", "start", "--kubeconfig=.\\kubeconfig"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM --platform=linux/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.21 as builder | ||
|
||
# Build args | ||
ARG VERSION | ||
ARG APP_INSIGHTS_ID | ||
|
||
ENV GOOS=windows | ||
ENV GOARCH=amd64 | ||
|
||
WORKDIR /usr/src/retina | ||
# Copy the source | ||
COPY . . | ||
|
||
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X main.version="$VERSION" -X "main.applicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/ | ||
RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/ | ||
|
||
# Copy into final image | ||
FROM mcr.microsoft.com/windows/servercore:ltsc2022 as final | ||
COPY --from=builder /usr/src/retina/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml | ||
COPY --from=builder /usr/src/retina/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 | ||
COPY --from=builder /usr/bin/controller.exe controller.exe | ||
COPY --from=builder /usr/bin/captureworkload.exe captureworkload.exe | ||
|
||
ADD https://github.com/microsoft/etl2pcapng/releases/download/v1.10.0/etl2pcapng.exe /etl2pcapng.exe | ||
|
||
CMD ["controller.exe", "start", "--kubeconfig=.\\kubeconfig"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM --platform=windows/amd64 mcr.microsoft.com/oss/go/microsoft/golang:1.22.2-windowsservercore-ltsc2022 as cgo | ||
|
||
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
Invoke-WebRequest -UseBasicParsing -uri "https://github.com/msys2/msys2-installer/releases/download/2024-01-13/msys2-base-x86_64-20240113.sfx.exe" -OutFile msys2.exe; \ | ||
.\msys2.exe -y -oC:\; \ | ||
Remove-Item msys2.exe ; \ | ||
function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } \ | ||
msys ' '; \ | ||
msys 'pacman --noconfirm -Syuu'; \ | ||
msys 'pacman --noconfirm -S mingw-w64-x86_64-gcc'; \ | ||
msys 'pacman --noconfirm -Scc'; | ||
|
||
# pure magic: https://github.com/MicrosoftDocs/Virtualization-Documentation/blob/3f7c7ed7ef8d582c74ec740414c54f25bf5850c0/windows-container-samples/golang/Dockerfile#L15C1-L15C179 | ||
RUN setx path "C:\msys64\mingw64\bin" | ||
|
||
FROM cgo as builder | ||
WORKDIR C:\\pktmon | ||
COPY .\\pkg\\plugin\\windows\\pktmon\\packetmonitorsupport . |
Oops, something went wrong.