Skip to content

Instantly share code, notes, and snippets.

@ofrzeta
Created January 23, 2019 09:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ofrzeta/3bb08efc79f4c33fa267835b72bc96f6 to your computer and use it in GitHub Desktop.
Save ofrzeta/3bb08efc79f4c33fa267835b72bc96f6 to your computer and use it in GitHub Desktop.
---
kind: "BuildConfig"
apiVersion: "v1"
metadata:
name: "mytestbuild"
spec:
runPolicy: "Serial"
source:
dockerfile: |-
FROM golang:alpine AS builder
ENV alertmanager_version v0.15.3
RUN apk -U add binutils git make && \
mkdir -p $GOPATH/src/github.com/prometheus && \
cd $GOPATH/src/github.com/prometheus && \
git clone https://github.com/prometheus/alertmanager.git && \
cd alertmanager && \
git checkout ${alertmanager_version} && \
make build
FROM alpine
WORKDIR /alertmanager
COPY --from=builder /go/src/github.com/prometheus/alertmanager/alertmanager /bin/alertmanager
COPY --from=builder /go/src/github.com/prometheus/alertmanager/amtool /bin/amtool
COPY --from=builder /bin/ash /bin/ash
COPY --from=builder /bin/sleep /bin/sleep
EXPOSE 9093
EXPOSE 9094
ENTRYPOINT /bin/sleep 24d
strategy:
dockerStrategy:
noCache: true
output:
to:
kind: "ImageStreamTag"
name: mytestbuildimage:v0.15.3
---
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: mytestbuildimage
spec:
lookupPolicy:
local: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment