Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitlab/scripts/Dockerfile.build_layer
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ ARG DATADOG_WRAPPER=datadog_wrapper
ARG SUFFIX

RUN apt-get update
RUN apt-get install -y zip binutils upx
RUN apt-get install -y zip binutils

COPY .binaries/datadog-agent-$SUFFIX /datadog-agent-go
RUN strip /datadog-agent-go
RUN upx -1 /datadog-agent-go
RUN if [ "$PLATFORM" = "x86_64" ]; then apt-get install -y upx=3.96-r0 && upx -1 /datadog-agent-go; fi

RUN mkdir /extensions
WORKDIR /extensions
Expand Down
5 changes: 5 additions & 0 deletions .gitlab/scripts/Dockerfile.go_agent.alpine.compile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we measure the cold start for alpine images?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good q

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self monitoring seems to have the expected slightly above value

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ RUN /usr/lib/go/bin/go tool nm datadog-agent | grep -w 'github.com/DataDog/datad
(echo "agentVersionDefault variable doesn't exist" && exit 1)

RUN strip datadog-agent
RUN arch="$(uname -m)"; \
if [ "${arch}" = 'x86_64' ]; then \
apk add --no-cache upx=3.96-r1 && upx -1 datadog-agent; \
fi;


# keep the smallest possible docker image
FROM scratch
Expand Down
1 change: 1 addition & 0 deletions .gitlab/scripts/Dockerfile.go_agent.compile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN /usr/local/go/bin/go tool nm datadog-agent | grep -w 'github.com/DataDog/dat
(echo "agentVersionDefault variable doesn't exist" && exit 1)

RUN strip datadog-agent
RUN if [ "$arch" = "x86_64" ]; then apt-get install -y upx=3.96-r0 && upx -1 /datadog-agent; fi

# keep the smallest possible docker imag
FROM scratch
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/scripts/check_layer_size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ -z "$LAYER_FILE" ]; then
fi

MAX_LAYER_COMPRESSED_SIZE_KB=$(( 23 * 1024)) # 23 MB, amd64 is 22, while arm64 is 20
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(( 30 * 1024)) # 53 MB -> 30MB with UPX
MAX_LAYER_UNCOMPRESSED_SIZE_KB=$(( 54 * 1024 )) # 53 MB, amd is 53, while arm64 is 47

FILE=".layers"/$LAYER_FILE
FILE_SIZE=$(stat --printf="%s" "$FILE")
Expand Down
4 changes: 2 additions & 2 deletions scripts/Dockerfile.bottlecap.alpine.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ ARG DATADOG_WRAPPER=datadog_wrapper
ARG GO_AGENT_PATH

RUN apt-get update
RUN apt-get install -y zip binutils upx
RUN apt-get install -y zip binutils

COPY .layers/$GO_AGENT_PATH/extensions/datadog-agent /datadog-agent-go
RUN strip /datadog-agent-go
RUN upx -1 /datadog-agent-go
RUN if [ "$PLATFORM" = "x86_64" ]; then apt-get install -y upx=3.96-r0 && upx -1 /datadog-agent-go; fi


RUN mkdir /extensions
Expand Down
4 changes: 2 additions & 2 deletions scripts/Dockerfile.bottlecap.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ ARG DATADOG_WRAPPER=datadog_wrapper
ARG GO_AGENT_PATH

RUN apt-get update
RUN apt-get install -y zip binutils upx
RUN apt-get install -y zip binutils
COPY .layers/$GO_AGENT_PATH/extensions/datadog-agent /datadog-agent-go
RUN strip /datadog-agent-go
RUN upx -1 /datadog-agent-go
RUN if [ "$PLATFORM" = "x86_64" ]; then apt-get install -y upx=3.96-r0 && upx -1 /datadog-agent-go; fi


RUN mkdir /extensions
Expand Down
6 changes: 2 additions & 4 deletions scripts/Dockerfile.bottlecap.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ FROM ubuntu:22.04 as compresser
ARG DATADOG_WRAPPER=datadog_wrapper

RUN apt-get update
RUN apt-get install -y zip binutils upx
RUN apt-get install -y zip binutils
COPY --from=public.ecr.aws/datadog/lambda-extension:64 /opt/datadog-agent-go /datadog-agent-go
RUN du -h /datadog-agent-go
RUN upx -1 /datadog-agent-go
RUN du -h /datadog-agent-go
RUN if [ "$PLATFORM" = "x86_64" ]; then apt-get install -y upx=3.96-r0 && upx -1 /datadog-agent-go; fi
RUN mkdir /extensions
WORKDIR /extensions

Expand Down
Loading