Skip to content

Commit

Permalink
images: Add metalk8s-alert-logger container image
Browse files Browse the repository at this point in the history
This container image is used for alert history.

Refs: #3180
  • Loading branch information
alexandre-allard committed Apr 6, 2021
1 parent d1185a8 commit eb5add1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions images/metalk8s-alert-logger/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ARG BUILD_IMAGE_NAME=golang
ARG BUILD_IMAGE_TAG=1.16.0-alpine
FROM $BUILD_IMAGE_NAME:$BUILD_IMAGE_TAG AS builder

ENV CGO_ENABLED=0

ARG ALERTMANAGER_VERSION=latest
ARG PKG_PATH=/go/src/metalk8s-alert-logger/

RUN mkdir -p "$PKG_PATH"

COPY main.go go.mod "$PKG_PATH"

WORKDIR "$PKG_PATH"

RUN sed -i "s/@@ALERTMANAGER_VERSION@@/$ALERTMANAGER_VERSION/g" go.mod \
&& go mod tidy \
&& go install

ARG RUN_IMAGE_NAME=alpine
ARG RUN_IMAGE_TAG=3.13.2
FROM $RUN_IMAGE_NAME:$RUN_IMAGE_TAG

MAINTAINER moonshot-platform <[email protected]>

COPY --from=builder /go/bin/ /usr/bin/

EXPOSE 19094

ENTRYPOINT ["metalk8s-alert-logger"]

0 comments on commit eb5add1

Please sign in to comment.