Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build
run: |
go build -o prometheus-msk-discovery-linux-amd64
GOOS=linux GOARCH=amd64 go build -o prometheus-msk-discovery-linux-amd64
GOOS=linux GOARCH=arm64 go build -o prometheus-msk-discovery-linux-arm64

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "prometheus-msk-discovery-linux-amd64"
files: |
prometheus-msk-discovery-linux-amd64
prometheus-msk-discovery-linux-arm64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
FROM golang:1.23-alpine
FROM golang:1.23-alpine AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src
RUN apk --no-cache add git
COPY main.go go.mod go.sum ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/prometheus-msk-discovery .
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o /bin/prometheus-msk-discovery .

FROM alpine:latest
RUN apk --no-cache add ca-certificates
COPY --from=0 /bin/prometheus-msk-discovery /bin/
COPY --from=builder /bin/prometheus-msk-discovery /bin/
ENTRYPOINT ["prometheus-msk-discovery"]