forked from verrazzano/verrazzano
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (41 loc) · 2.9 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
51
52
53
54
55
# Copyright (C) 2020, 2021, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
FROM ghcr.io/oracle/oraclelinux:7-slim AS build_base
ARG VERRAZZANO_APPLICATION_OPERATOR_IMAGE
# Need to use specific WORKDIR to match verrazzano's source packages
WORKDIR /root/go/src/github.com/verrazzano/verrazzano/platform-operator
COPY . .
COPY out/linux_amd64/verrazzano-platform-operator /usr/local/bin/verrazzano-platform-operator
RUN chmod 500 /usr/local/bin/verrazzano-platform-operator \
&& chmod +x scripts/install/*.sh \
&& chmod +x scripts/uninstall/*.sh \
&& chmod +x scripts/uninstall/uninstall-steps/*.sh
# Create the verrazzano-platform-operator image
FROM ghcr.io/oracle/oraclelinux:7-slim
ARG VERRAZZANO_APPLICATION_OPERATOR_IMAGE
# Use olcne13, which is required for kubectl 1.20.6-2
RUN yum update -y \
&& yum install -y openssl jq patch \
&& yum-config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL7/olcne13/x86_64/ \
&& yum install -y kubectl-1.20.6-2.el7 \
&& yum install -y helm-3.3.4-2.el7 \
&& yum clean all \
&& rm -rf /var/cache/yum
RUN groupadd -r verrazzano \
&& useradd --no-log-init -r -m -d /verrazzano -g verrazzano -u 1000 verrazzano \
&& mkdir /home/verrazzano \
&& chown -R 1000:verrazzano /home/verrazzano
# Copy the operator binary
COPY --from=build_base --chown=verrazzano:verrazzano /usr/local/bin/verrazzano-platform-operator /usr/local/bin/verrazzano-platform-operator
# Copy the Verrazzano install and uninstall scripts
WORKDIR /verrazzano
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/thirdparty ./platform-operator/thirdparty
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/scripts/install ./platform-operator/scripts/install
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/scripts/uninstall ./platform-operator/scripts/uninstall
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/config/scripts/run.sh .
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/config/scripts/kubeconfig-template ./config/kubeconfig-template
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/helm_config ./platform-operator/helm_config
COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/verrazzano/platform-operator/out/generated-verrazzano-bom.json ./platform-operator/verrazzano-bom.json
COPY --from=build_base /root/go/src/github.com/verrazzano/verrazzano/platform-operator/THIRD_PARTY_LICENSES.txt /licenses/
USER 1000
ENTRYPOINT ["/verrazzano/run.sh"]