-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathecho.Dockerfile
More file actions
40 lines (30 loc) · 1.38 KB
/
echo.Dockerfile
File metadata and controls
40 lines (30 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM golang:1.25-alpine AS build
RUN apk add --no-cache jq curl bash gcc musl-dev git
# print important lib versions
RUN go version && curl --version
# build application binary
COPY utils/build/docker/golang/app/ /app/
WORKDIR /app
ENV GOCACHE=/root/.cache/go-build \
GOMODCACHE=/go/pkg/mod
RUN --mount=type=cache,target=${GOMODCACHE} \
--mount=type=cache,target=${GOCACHE} \
--mount=type=tmpfs,target=/tmp \
--mount=type=bind,source=utils/build/docker/golang,target=/utils \
--mount=type=bind,source=binaries,target=/binaries \
go mod download && go mod verify && \
/utils/install_ddtrace.sh && \
go build -v -tags=appsec -o=./weblog ./echo
# ==============================================================================
FROM golang:1.25-alpine
RUN apk add --no-cache curl bash gcc musl-dev
COPY --from=build /app/weblog /app/weblog
COPY --from=build /app/SYSTEM_TESTS_LIBRARY_VERSION /app/SYSTEM_TESTS_LIBRARY_VERSION
WORKDIR /app
# Datadog setup
ENV DD_TRACE_HEADER_TAGS='user-agent' \
DD_DATA_STREAMS_ENABLED=true \
DD_LOGGING_RATE=0
RUN printf "#!/bin/bash\nexec ./weblog" > app.sh
RUN chmod +x app.sh
CMD ["./app.sh"]