Skip to content

Commit

Permalink
fix(Containerfile): best practices, optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime1907 committed Sep 23, 2024
1 parent c214b10 commit 9682a4a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ ENV CGO_ENABLED=0
ENV GOOS=linux
ENV GOARCH=amd64

ARG JQ_VERSION=1.7

# hadolint ignore=DL3018
RUN apk update && apk add --no-cache bash git make binutils wget \
&& wget --progress=dot:giga "https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-${GOOS}-${GOARCH}" -O /usr/bin/jq \
&& chmod +x /usr/bin/jq
RUN apk update \
&& apk add --no-cache \
make binutils

WORKDIR $GOPATH/src/github.com/wiremind/ovh-exporter

COPY . .

RUN make ovh-exporter && mv ovh-exporter /usr/bin/


FROM busybox:stable AS runtime

COPY --from=build /usr/bin/ovh-exporter /usr/bin/ovh-exporter

ENTRYPOINT ["/usr/bin/ovh-exporter"]

CMD ["serve"]

0 comments on commit 9682a4a

Please sign in to comment.