|
1 | | -# pinned base image |
| 1 | +# skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.25.7-azurelinux3.0 --format "{{.Name}}@{{.Digest}}" |
| 2 | +ARG BUILDPLATFORM |
| 3 | +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/oss/go/microsoft/golang@sha256:408661cbcfcbf24c06fc4f85c23566b42af722fdef5a5044782859e682916be7 AS builder |
| 4 | + |
| 5 | +# Build args |
| 6 | +ARG VERSION |
| 7 | +ARG APP_INSIGHTS_ID |
| 8 | + |
| 9 | +ENV GOOS=windows |
| 10 | +ENV GOARCH=amd64 |
| 11 | + |
| 12 | +WORKDIR /usr/src/retina |
| 13 | +# Copy the source |
| 14 | +COPY . . |
| 15 | + |
| 16 | +RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/controller.exe -ldflags "-X github.com/microsoft/retina/internal/buildinfo.Version="$VERSION" -X "github.com/microsoft/retina/internal/buildinfo.ApplicationInsightsID"="$APP_INSIGHTS_ID"" ./controller/ |
| 17 | +RUN --mount=type=cache,target="/root/.cache/go-build" go build -v -o /usr/bin/captureworkload.exe ./captureworkload/ |
| 18 | + |
| 19 | +# Copy into final image |
2 | 20 | # skopeo inspect docker://mcr.microsoft.com/windows/servercore:ltsc2019 --override-os windows --format "{{.Name}}@{{.Digest}}" |
3 | | -FROM mcr.microsoft.com/windows/servercore@sha256:a3d7773c4a836c2efd3ecb89f4fcb41199ee56d454225cf72a65b603bf569eca AS ltsc2019 |
| 21 | +FROM mcr.microsoft.com/windows/servercore@sha256:a3d7773c4a836c2efd3ecb89f4fcb41199ee56d454225cf72a65b603bf569eca AS agent-win |
| 22 | +COPY --from=builder /usr/src/retina/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml |
| 23 | +COPY --from=builder /usr/src/retina/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 |
| 24 | +COPY --from=builder /usr/bin/controller.exe controller.exe |
| 25 | +COPY --from=builder /usr/bin/captureworkload.exe captureworkload.exe |
4 | 26 |
|
5 | | -FROM ltsc2019 AS agent-win |
6 | | -ARG GOARCH=amd64 # default to amd64 |
7 | | -ARG GOOS=windows # default to windows |
8 | | -ARG OS_VERSION=ltsc2019 |
9 | | -ARG REPO_PATH |
10 | | -ARG BINARIES_PATH |
11 | | -ENV GOARCH=${GOARCH} |
12 | | -ENV GOOS=${GOOS} |
13 | | -ENV OS_VERSION=${OS_VERSION} |
14 | | -ENV BINARIES_PATH=${BINARIES_PATH} |
15 | | -ENV REPO_PATH=${REPO_PATH} |
16 | | -# CVE-2013-3900 Mitigation |
17 | | -RUN reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Wintrust\Config" /v "EnableCertPaddingCheck" /t REG_DWORD /d "1" /f |
18 | | -RUN reg add "HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Cryptography\Wintrust\Config" /v "EnableCertPaddingCheck" /t REG_DWORD /d "1" /f |
19 | | -COPY ${REPO_PATH}/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml |
20 | | -COPY ${REPO_PATH}/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 |
21 | | -COPY ${BINARIES_PATH}/captureworkload.exe captureworkload.exe |
22 | | -COPY ${BINARIES_PATH}/controller.exe controller.exe |
23 | 27 | ADD https://github.com/microsoft/etl2pcapng/releases/download/v1.10.0/etl2pcapng.exe /etl2pcapng.exe |
| 28 | + |
24 | 29 | CMD ["controller.exe", "start", "--kubeconfig=.\\kubeconfig"] |
0 commit comments