github.com/verrazzano/verrazzano@v1.7.0/cluster-operator/Dockerfile (about)

     1  # Copyright (C) 2022, 2023, Oracle and/or its affiliates.
     2  # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
     3  
     4  ARG BASE_IMAGE=ghcr.io/oracle/oraclelinux:8-slim
     5  FROM $BASE_IMAGE AS build_base
     6  
     7  # Need to use specific WORKDIR to match verrazzano-cluster-operator's source packages
     8  WORKDIR /root/go/src/github.com/verrazzano/cluster-operator
     9  COPY . .
    10  
    11  COPY out/linux_amd64/verrazzano-cluster-operator /usr/local/bin/verrazzano-cluster-operator
    12  
    13  RUN chmod 500 /usr/local/bin/verrazzano-cluster-operator \
    14      && chmod 500 /root/go/src/github.com/verrazzano/cluster-operator/scripts/wait4webhook.sh
    15  
    16  # Create the verrazzano-cluster-operator image
    17  FROM $BASE_IMAGE AS final
    18  
    19  RUN rm -rf /var/cache/yum /var/lib/rpm/* \
    20      && groupadd -r verrazzano  \
    21      && useradd --no-log-init -r -g verrazzano -u 1000 verrazzano \
    22      && mkdir /home/verrazzano \
    23      && chown -R 1000:verrazzano /home/verrazzano
    24  
    25  # Copy the operator binary
    26  COPY --from=build_base --chown=verrazzano:verrazzano /usr/local/bin/verrazzano-cluster-operator /usr/local/bin/verrazzano-cluster-operator
    27  COPY --from=build_base --chown=verrazzano:verrazzano /root/go/src/github.com/verrazzano/cluster-operator/scripts/wait4webhook.sh /usr/local/bin/wait4webhook.sh
    28  
    29  COPY --from=build_base /root/go/src/github.com/verrazzano/cluster-operator/THIRD_PARTY_LICENSES.txt /licenses/
    30  
    31  USER 1000
    32  
    33  ENTRYPOINT ["/usr/local/bin/verrazzano-cluster-operator"]