Skip to content

Commit

Permalink
Merge pull request #1 from BedrockStreaming/feat/build-from-docker
Browse files Browse the repository at this point in the history
feat(build): Build binary from docker
  • Loading branch information
vgallissot authored Jul 13, 2023
2 parents 3e8d797 + fdd6a0c commit 2cdcc92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
.*
vendor
Dockerfile
Makefile
README.md
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Multistage build
# #1 stage to build the Go binary
FROM golang AS builder
WORKDIR /usr/src/app
COPY . .
RUN make build

# #2 stage copies binary from #1 + entrypoint
FROM quay.io/prometheus/busybox:latest
MAINTAINER kwanhur <[email protected]>

COPY ipvs-exporter /usr/bin/ipvs-exporter
COPY --from=builder /usr/src/app/ipvs-exporter /usr/bin/ipvs-exporter
COPY docker-entrypoint.sh /bin/docker-entrypoint.sh
RUN chmod 755 /bin/docker-entrypoint.sh

ENV METRICS_ENDPOINT "/metrics"
ENV METRICS_ADDR ":9911"
ENV DEFAULT_METRICS_NS "ipvs"

ENTRYPOINT [ "docker-entrypoint.sh" ]
ENTRYPOINT [ "docker-entrypoint.sh" ]

0 comments on commit 2cdcc92

Please sign in to comment.