|
| 1 | +# |
| 2 | +# Copyright 2020-2023 Red Hat, Inc. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +FROM registry.access.redhat.com/ubi8/go-toolset:1.18 AS builder |
| 16 | + |
| 17 | +# Set user as root |
| 18 | +USER root |
| 19 | + |
| 20 | +# Install yq |
| 21 | +RUN curl -sL -O https://github.com/mikefarah/yq/releases/download/v4.9.5/yq_linux_amd64 -o /usr/local/bin/yq && mv ./yq_linux_amd64 /usr/local/bin/yq && chmod +x /usr/local/bin/yq |
| 22 | + |
| 23 | +COPY . /registry |
| 24 | + |
| 25 | +# Download the registry build tools |
| 26 | +RUN git clone https://github.com/mike-hoang/registry-support.git /registry-support |
| 27 | + |
| 28 | +# Download all the offline parent devfiles |
| 29 | +RUN bash /registry-support/build-tools/dl_parent_devfiles.sh |
| 30 | + |
| 31 | +# Download all the offline starter projects |
| 32 | +RUN bash /registry-support/build-tools/dl_starter_projects.sh |
| 33 | + |
| 34 | +# Update all devfiles to use offline starter projects |
| 35 | +RUN bash /registry-support/build-tools/update_devfiles_offline.sh |
| 36 | + |
| 37 | +# Run the registry build tools |
| 38 | +RUN bash /registry-support/build-tools/build.sh /registry /build |
| 39 | + |
| 40 | +# Extract archived resources |
| 41 | +RUN bash /registry-support/build-tools/extract_resources.sh |
| 42 | + |
| 43 | +FROM quay.io/devfile/devfile-index-base:next |
| 44 | + |
| 45 | +# Set user as non-root |
| 46 | +USER 1001 |
| 47 | + |
| 48 | +COPY --from=builder /build /registry |
0 commit comments