Skip to content

Commit

Permalink
feat: Added Containerfile as a multistage build for the extension
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
  • Loading branch information
adrianriobo committed May 23, 2024
1 parent 8f3c817 commit 5707ecd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: oci/Containerfile.multistage
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/crc-org/crc-extension:latest
29 changes: 12 additions & 17 deletions Dockerfile → oci/Containerfile.multistage
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,22 @@
#
# SPDX-License-Identifier: Apache-2.0

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

COPY . .

RUN npm install -g yarn \
&& npx yarn install \
&& npx yarn build

RUN mkdir /tmp/extension \
&& cp /opt/app-root/src/package.json \
/opt/app-root/src/LICENSE \
/opt/app-root/src/README.md \
/opt/app-root/src/icon.png /tmp/extension \
&& cp -r /opt/app-root/src/dist /tmp/extension/dist

RUN yarn --network-timeout 180000 \
&& yarn build

FROM scratch

LABEL org.opencontainers.image.title="Red Hat OpenShift Local" \
org.opencontainers.image.description="Integration for Red Hat OpenShift Local clusters" \
org.opencontainers.image.vendor="redhat" \
io.podman-desktop.api.version=">= 0.16.0"

COPY --from=builder /tmp/extension/ /extension
org.opencontainers.image.description="Integration for Red Hat OpenShift Local clusters" \
org.opencontainers.image.vendor="redhat" \
io.podman-desktop.api.version=">= 0.16.0"

COPY package.json /extension/
COPY LICENSE /extension/
COPY icon.png /extension/
COPY README.md /extension/
COPY --from=builder /opt/app-root/src/dist /extension/dist

0 comments on commit 5707ecd

Please sign in to comment.