forked from aws/amazon-cloudwatch-agent
-
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.
Add support for Container Insights on Windows in otel repo (aws#1076)
- Loading branch information
1 parent
79d7271
commit 9ac52c9
Showing
17 changed files
with
608 additions
and
202 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
22 changes: 22 additions & 0 deletions
22
amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/localbin/Dockerfile.Windows
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,22 @@ | ||
# This Dockerfile can be used for building Windows Server 2019, 2022 Container images. | ||
|
||
# Build Container image from binary in local | ||
ARG TAG=ltsc2022 | ||
ARG TARGETARCH=amd64 | ||
ARG CONTAINER_CLOUDWATCHAGENT_PATH=C:\\Program\ Files\\Amazon\\AmazonCloudWatchAgent\\ | ||
ARG CONTAINER_CLOUDWATCHAGENT_DATA_PATH=C:\\ProgramData\\Amazon\\AmazonCloudWatchAgent\\ | ||
|
||
FROM mcr.microsoft.com/windows/servercore:$TAG as runtime | ||
|
||
ARG CONTAINER_CLOUDWATCHAGENT_PATH | ||
ARG CONTAINER_CLOUDWATCHAGENT_DATA_PATH | ||
ARG TARGETARCH | ||
|
||
RUN Powershell -Command New-Item -ItemType Directory -Path $Env:CONTAINER_CLOUDWATCHAGENT_PATH -Force | ||
RUN Powershell -Command New-Item -ItemType Directory -Path $Env:CONTAINER_CLOUDWATCHAGENT_DATA_PATH -Force | ||
WORKDIR $CONTAINER_CLOUDWATCHAGENT_PATH | ||
|
||
COPY "./tmp/windows_${TARGETARCH}" $CONTAINER_CLOUDWATCHAGENT_PATH | ||
|
||
ENV RUN_IN_CONTAINER="True" | ||
CMD ["start-amazon-cloudwatch-agent.exe"] |
20 changes: 20 additions & 0 deletions
20
amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/localmsi/Dockerfile.Windows
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 @@ | ||
# This Dockerfile can be used for building Windows Server 2019, 2022 Container images. | ||
|
||
# Build Container image from msi installer | ||
ARG IMAGE_TAG=ltsc2022 | ||
ARG BUILD_IMAGE=mcr.microsoft.com/windows/servercore:$IMAGE_TAG | ||
ARG TARGETARCH=amd64 | ||
ARG CONTAINER_CLOUDWATCHAGENT_PATH=C:\\Program\ Files\\Amazon\\AmazonCloudWatchAgent\\ | ||
|
||
FROM $BUILD_IMAGE | ||
|
||
ARG TARGETARCH | ||
ARG CONTAINER_CLOUDWATCHAGENT_PATH | ||
|
||
COPY ${TARGETARCH}/amazon-cloudwatch-agent.msi C:\\tmp\\amazon-cloudwatch-agent.msi | ||
RUN msiexec /i C:\\tmp\\amazon-cloudwatch-agent.msi | ||
|
||
WORKDIR $CONTAINER_CLOUDWATCHAGENT_PATH | ||
|
||
ENV RUN_IN_CONTAINER="True" | ||
CMD ["start-amazon-cloudwatch-agent.exe"] |
45 changes: 45 additions & 0 deletions
45
amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/source/Dockerfile.Windows
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,45 @@ | ||
# This Dockerfile can be used for building Windows Server 2019, 2022 Container images. | ||
|
||
ARG TAG=ltsc2022 | ||
ARG TARGETARCH=amd64 | ||
ARG CONTAINER_CLOUDWATCHAGENT_PATH=C:\\Program\ Files\\Amazon\\AmazonCloudWatchAgent\\ | ||
ARG GO_IMAGE=golang:latest | ||
|
||
# Build CW agent inside Windows golang container | ||
FROM $GO_IMAGE as builder | ||
|
||
ARG TARGETARCH | ||
|
||
RUN New-Item -ItemType Directory -Path "C:\go\src\github.com\aws\amazon-cloudwatch-agent" -Force | ||
WORKDIR "C:\go\src\github.com\aws\amazon-cloudwatch-agent" | ||
|
||
ENV GOPROXY=direct | ||
ARG GO111MODULE="on" | ||
ENV GO111MODULE=${GO111MODULE} | ||
|
||
COPY go.mod "C:\go\src\github.com\aws\amazon-cloudwatch-agent" | ||
COPY go.sum "C:\go\src\github.com\aws\amazon-cloudwatch-agent" | ||
RUN go mod download -x | ||
|
||
COPY . "C:\go\src\github.com\aws\amazon-cloudwatch-agent" | ||
|
||
# Install chocolatey and make | ||
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | ||
RUN choco install make | ||
|
||
# Run make and build CW agent inside container | ||
RUN make build-for-docker-windows-${env:TARGETARCH} | ||
|
||
# Build target CW agent container image for Windows | ||
FROM mcr.microsoft.com/windows/servercore:$TAG | ||
|
||
ARG CONTAINER_CLOUDWATCHAGENT_PATH | ||
ARG TARGETARCH | ||
|
||
RUN Powershell -Command New-Item -ItemType Directory -Path $env:CONTAINER_CLOUDWATCHAGENT_PATH -Force | ||
WORKDIR $CONTAINER_CLOUDWATCHAGENT_PATH | ||
|
||
COPY --from=builder C:\\go\\src\\github.com\\aws\\amazon-cloudwatch-agent\\build\\bin\\windows_$TARGETARCH\\ $CONTAINER_CLOUDWATCHAGENT_PATH | ||
|
||
ENV RUN_IN_CONTAINER="True" | ||
CMD ["start-amazon-cloudwatch-agent.exe"] |
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
Oops, something went wrong.