-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
18 lines (15 loc) · 985 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
FROM alpine:3.21.0
# Set by Docker automatically.
# If building with `docker build` directly, make sure to set GOOS/GOARCH explicitly when calling make:
# `make build GOOS=linux GOARCH=amd64`
# Otherwise, make will not add suffixes to the binary name and Docker will not be able to find it.
# Alternatively, `make image` can also take care of producing the binary with the correct name and then running
# `docker build` for you.
ARG TARGETOS
ARG TARGETARCH
# Some old-ish versions of Docker do not support adding and renaming in the same line, and will instead
# interpret the second argument as a new folder to create and place the original file inside.
# For this reason, we workaround with regular ADD and then run mv inside the container.
ADD --chmod=755 newrelic-k8s-metrics-adapter-${TARGETOS}-${TARGETARCH} ./
RUN mv newrelic-k8s-metrics-adapter-${TARGETOS}-${TARGETARCH} /usr/local/bin/newrelic-k8s-metrics-adapter
ENTRYPOINT ["/usr/local/bin/newrelic-k8s-metrics-adapter"]