github.com/RedHatInsights/insights-content-service@v1.0.0/Dockerfile (about)

     1  # Copyright 2020 Red Hat, Inc
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #      http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  FROM registry.access.redhat.com/ubi8/go-toolset:1.18.9-8.1675807488 AS builder
    16  
    17  COPY . .
    18  
    19  USER 0
    20  
    21  # clone rules content repository and build the content service
    22  RUN curl -ksL https://password.corp.redhat.com/RH-IT-Root-CA.crt \
    23           -o /etc/pki/ca-trust/source/anchors/RH-IT-Root-CA.crt && \
    24      update-ca-trust && \
    25      umask 0022 && \
    26      make build && \
    27      chmod a+x insights-content-service && \
    28      ./update_rules_content.sh
    29  
    30  FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
    31  
    32  COPY --from=builder /opt/app-root/src/insights-content-service .
    33  COPY --from=builder /opt/app-root/src/openapi.json /openapi/openapi.json
    34  COPY --from=builder /opt/app-root/src/groups_config.yaml /groups/groups_config.yaml
    35  
    36  # copy just the rule content instead of the whole ocp-rules repository
    37  COPY --from=builder /opt/app-root/src/rules-content /rules-content
    38  # copy tutorial/fake rule to external rules to be hit by all reports
    39  COPY rules/tutorial/content/ /rules-content/external/rules
    40  
    41  USER 1001
    42  
    43  CMD ["/insights-content-service"]