forked from observatorium/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (42 loc) · 1.8 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Build the manager binary
FROM golang:1.17-alpine as builder
RUN apk add --update --no-cache git bash
WORKDIR /workspace
# Copy the jsonnet source
COPY . operator/
COPY ./jsonnet/vendor/github.com/observatorium/observatorium/configuration/components/ components/
# Build
WORKDIR /workspace/operator
RUN GO111MODULE="on" go build github.com/brancz/locutus
FROM alpine:3.15 as runner
WORKDIR /
COPY --from=builder /workspace/operator/locutus /
COPY --from=builder /workspace/operator/jsonnet /
COPY --from=builder /workspace/components/ /components/
COPY --from=builder /workspace/operator/jsonnet/vendor/ /vendor/
RUN chgrp -R 0 /vendor && chmod -R g=u /vendor
RUN chgrp -R 0 /components && chmod -R g=u /components
ARG BUILD_DATE
ARG VERSION
ARG VCS_REF
ARG DOCKERFILE_PATH
ARG VCS_BRANCH
LABEL vendor="Observatorium" \
name="observatorium/operator" \
description="Observatorium Operator" \
io.k8s.display-name="observatorium/operator" \
io.k8s.description="Observatorium Operator" \
maintainer="Observatorium <[email protected]>" \
version="$VERSION" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.description="Observatorium Operator" \
org.label-schema.docker.cmd="docker run --rm observatorium/operator" \
org.label-schema.docker.dockerfile=$DOCKERFILE_PATH \
org.label-schema.name="observatorium/operator" \
org.label-schema.schema-version="1.0" \
org.label-schema.vcs-branch=$VCS_BRANCH \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/observatorium/operator" \
org.label-schema.vendor="observatorium/operator" \
org.label-schema.version=$VERSION
ENTRYPOINT ["/locutus", "--renderer=jsonnet", "--renderer.jsonnet.entrypoint=main.jsonnet", "--trigger=resource", "--trigger.resource.config=config.yaml"]