Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github
testdata
contrib
3 changes: 1 addition & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
- uses: actions/checkout@v7

- name: Build image
run: |
docker build --file Dockerfile --tag ghcr.io/netways/alertmanager-icinga-bridge --build-arg "BRIDGE_VERSION=${GITHUB_REF}" --build-arg "BRIDGE_COMMIT=${GITHUB_SHA}" .
run: make build-image CONTAINER_RUNTIME=docker "VERSION=${GITHUB_REF}"

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
Expand Down
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@
# Build Image
FROM docker.io/golang:1.27-trixie AS builder

ARG BRIDGE_VERSION=development
ARG BRIDGE_COMMIT=HEAD
WORKDIR /go/src/app

ENV CGO_ENABLED=0
COPY go.mod go.sum ./
RUN set -xe; \
go mod download

WORKDIR /go/src/app
COPY . .
ARG BRIDGE_VERSION=development

COPY . .
RUN set -ex; \
go build -ldflags="-s -w -X main.version=${BRIDGE_VERSION} -X main.commit=${BRIDGE_COMMIT}" -o /go/bin/alertmanager-icinga-bridge
make release "VERSION=${BRIDGE_VERSION}"

# Final Image
FROM gcr.io/distroless/static-debian13:nonroot

WORKDIR /

COPY --from=builder /go/bin/alertmanager-icinga-bridge /
COPY --from=builder /go/src/app/dist/ /

EXPOSE 8888

Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ VERSION?=latest
build-image:
$(CONTAINER_RUNTIME) build --pull \
--build-arg BRIDGE_VERSION=$(VERSION) \
--build-arg BRIDGE_COMMIT=$(COMMIT) \
Comment thread
martialblog marked this conversation as resolved.
Resolved
-t ghcr.io/netways/alertmanager-icinga-bridge:latest .
build:
mkdir -p dist; \
Expand Down
Loading