forked from observatorium/operator
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathContainerfile.operator
53 lines (44 loc) · 2.1 KB
/
Containerfile.operator
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
51
52
53
# Copyright Contributors to the Open Cluster Management project
# Licensed under the Apache License 2.0
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.21 AS builder
WORKDIR /workspace
# Copy the jsonnet source
COPY . operator/
COPY ./jsonnet/vendor/stolo-configuration/components/ components/
# Build
ADD https://github.com/stolostron/locutus/archive/e1e2a3b29ff27b2f31c272c2bc118f687b9b74b8.tar.gz /workspace/operator/locutus.tar.gz
WORKDIR /workspace/operator/locutus
RUN tar -xf /workspace/operator/locutus.tar.gz -C . --strip-components=1
RUN GO111MODULE="on" CGO_ENABLED=1 GOFLAGS="" go build
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
WORKDIR /
COPY --from=builder /workspace/operator/locutus/locutus /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"]