Created
August 15, 2023 09:33
-
-
Save redbaron/441e1b68f7e11b49ff038fafada5a3b6 to your computer and use it in GitHub Desktop.
Local telegraf build
This file contains hidden or 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
FROM golang:1.21 AS build | |
WORKDIR /app | |
COPY go.mod go.sum ./ | |
RUN --mount=type=cache,target=/root/.cache/go-build,rw go mod download | |
COPY . ./ | |
RUN --mount=type=cache,target=/root/.cache/go-build,rw go build -p 1 -o /telegraf ./cmd/telegraf | |
FROM gcr.io/distroless/base-debian11 | |
WORKDIR /app | |
COPY --from=build /telegraf /telegraf | |
USER nonroot:nonroot | |
ENTRYPOINT ["/telegraf"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment