Skip to content

Commit d95cbdb

Browse files
committed
debugging offline build
Signed-off-by: Michael Hoang <[email protected]>
1 parent 3e1922b commit d95cbdb

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.ci/Dockerfile.offline

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

.ci/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@
1515

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

18-
docker build --no-cache -t devfile-index -f $ABSOLUTE_PATH/Dockerfile $ABSOLUTE_PATH/..
18+
if [ $# -eq 1 ] && [ $1 == "offline" ]
19+
then
20+
docker build --no-cache -t devfile-index -f $ABSOLUTE_PATH/Dockerfile.offline $ABSOLUTE_PATH/..
21+
else
22+
docker build --no-cache -t devfile-index -f $ABSOLUTE_PATH/Dockerfile $ABSOLUTE_PATH/..
23+
fi

0 commit comments

Comments
 (0)