Skip to content

Commit

Permalink
update dockerfile and gitignore
Browse files Browse the repository at this point in the history
Signed-off-by: Tejas <jamdade.2@iitj.ac.in>
  • Loading branch information
0xt3j4s committed Nov 19, 2023
1 parent d96f31a commit 34409fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
KUBECONFIG

# Built Binary File
kubescape-exporter
prometheus-exporter

# Data stored by Grafana
data
9 changes: 5 additions & 4 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder

ENV GO111MODULE=on \
CGO_ENABLED=0
CGO_ENABLED=0 \
GOPROXY=https://proxy.golang.org,direct

# Set the working directory inside the container
WORKDIR /work

RUN --mount=target=. \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/kubescape-exporter .
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/prometheus-exporter .

FROM gcr.io/distroless/static-debian11:nonroot

# Copy the Pre-built binary file from the previous stage
COPY --from=builder /out/kubescape-exporter /usr/bin/kubescape-exporter
COPY --from=builder /out/prometheus-exporter /usr/bin/prometheus-exporter

# Entry Point
ENTRYPOINT [ "kubescape-exporter" ]
ENTRYPOINT [ "prometheus-exporter" ]

0 comments on commit 34409fe

Please sign in to comment.