Skip to content

Commit

Permalink
debugging offline build
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Hoang <[email protected]>
  • Loading branch information
mike-hoang committed Aug 28, 2023
1 parent 3e1922b commit e2e01a1
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .ci/Dockerfile.offline
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# Copyright 2020-2023 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM registry.access.redhat.com/ubi8/go-toolset:1.18 AS builder

# Set user as root
USER root

# Install yq
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

COPY . /registry

# Download the registry build tools
RUN git clone https://github.com/devfile/registry-support.git /registry-support

# Download all the offline parent devfiles
RUN bash /registry-support/build-tools/dl_parent_devfiles.sh

# Download all the offline starter projects
RUN bash /registry-support/build-tools/dl_starter_projects.sh

# Update all devfiles to use offline starter projects
RUN bash /registry-support/build-tools/update_devfiles_offline.sh

# Run the registry build tools
RUN bash /registry-support/build-tools/build.sh /registry /build

# Extract archived resources
RUN bash /registry-support/build-tools/extract_resources.sh

FROM quay.io/devfile/devfile-index-base:next

# Set user as non-root
USER 1001

COPY --from=builder /build /registry
7 changes: 6 additions & 1 deletion .ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,9 @@

ABSOLUTE_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

docker build --no-cache -t devfile-index -f $ABSOLUTE_PATH/Dockerfile $ABSOLUTE_PATH/..
if [ $# -eq 1 ] && [ $1 == "offline" ]
then
docker build --no-cache -t devfile-index -f $ABSOLUTE_PATH/Dockerfile.offline $ABSOLUTE_PATH/..
else
docker build --no-cache -t devfile-index -f $ABSOLUTE_PATH/Dockerfile $ABSOLUTE_PATH/..
fi

0 comments on commit e2e01a1

Please sign in to comment.