forked from openshift/managed-cluster-config
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (29 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
40 lines (29 loc) · 1.09 KB
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
FROM openshift/origin-cli:4.12 AS builder
# Bring promtool from prometheus image
FROM quay.io/prometheus/prometheus AS promtool
# Multistage with python
FROM ubi8/python-39 AS runner
# Bring oc binary to python image
COPY --from=builder /bin/oc /bin/
# Bring promtool binary from prometheus image
COPY --from=promtool /bin/promtool /bin/
# Install jq and git
USER root
RUN dnf install -y jq git && dnf clean all
USER default
# Environment
ARG IN_CONTAINER="true"
ENV REPO_PATH=/managed-cluster-config
# Copy repo into container image:
COPY --chown=default . ${REPO_PATH}
WORKDIR ${REPO_PATH}
# Upgrade pip and install necessasry packages
RUN pip install --disable-pip-version-check oyaml
ADD --chown=default https://github.com/open-cluster-management-io/policy-generator-plugin/releases/download/v1.9.1/linux-amd64-PolicyGenerator /opt/app-root/bin/PolicyGenerator
RUN chmod +x /opt/app-root/bin/PolicyGenerator
# Make
RUN make
# This image will be replaced by the openshift/release
FROM openshift/origin-cli:4.12
# Ensure make ran as expected
COPY --from=runner /managed-cluster-config/deploy/ deploy