Skip to content

Commit 3af46c5

Browse files
committed
feat: Added Containerfile as a multistage build for the extension
Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
1 parent 8f3c817 commit 3af46c5

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424

2525
jobs:
2626
release:
27-
runs-on: ubuntu-22.04
27+
runs-on: ubuntu-24.04
2828
steps:
2929
- name: Set up QEMU
3030
uses: docker/setup-qemu-action@v2
@@ -46,6 +46,7 @@ jobs:
4646
uses: docker/build-push-action@v4
4747
with:
4848
context: .
49+
file: oci/Containerfile.multistage
4950
platforms: linux/amd64,linux/arm64
5051
push: true
5152
tags: ghcr.io/crc-org/crc-extension:latest

Dockerfile renamed to oci/Containerfile.multistage

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,22 @@
1515
#
1616
# SPDX-License-Identifier: Apache-2.0
1717

18-
FROM registry.access.redhat.com/ubi9/nodejs-18:latest AS builder
18+
FROM ghcr.io/crc-org/crc-extension-builder:latest AS builder
1919

2020
COPY . .
2121

22-
RUN npm install -g yarn \
23-
&& npx yarn install \
24-
&& npx yarn build
25-
26-
RUN mkdir /tmp/extension \
27-
&& cp /opt/app-root/src/package.json \
28-
/opt/app-root/src/LICENSE \
29-
/opt/app-root/src/README.md \
30-
/opt/app-root/src/icon.png /tmp/extension \
31-
&& cp -r /opt/app-root/src/dist /tmp/extension/dist
32-
22+
RUN yarn --network-timeout 180000 \
23+
&& yarn build
3324

3425
FROM scratch
3526

3627
LABEL org.opencontainers.image.title="Red Hat OpenShift Local" \
37-
org.opencontainers.image.description="Integration for Red Hat OpenShift Local clusters" \
38-
org.opencontainers.image.vendor="redhat" \
39-
io.podman-desktop.api.version=">= 0.16.0"
40-
41-
COPY --from=builder /tmp/extension/ /extension
28+
org.opencontainers.image.description="Integration for Red Hat OpenShift Local clusters" \
29+
org.opencontainers.image.vendor="redhat" \
30+
io.podman-desktop.api.version=">= 0.16.0"
31+
32+
COPY package.json /extension/
33+
COPY LICENSE /extension/
34+
COPY icon.png /extension/
35+
COPY README.md /extension/
36+
COPY --from=builder /opt/app-root/src/dist /extension/dist

0 commit comments

Comments
 (0)