forked from microsoft/retina
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ci): add azp image builds (microsoft#250)
# Description Need to be able to build images in azp as well. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [ ] I have correctly attributed the author(s) of the code. - [ ] I have tested the changes locally. - [ ] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project. --------- Signed-off-by: Mathew Merrick <[email protected]> Co-authored-by: Tahmid Alam <[email protected]>
- Loading branch information
1 parent
23e0a4e
commit f4af0f4
Showing
12 changed files
with
387 additions
and
19 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
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.