Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support build on arm64 platform #216

Merged
merged 8 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 143 additions & 7 deletions .github/workflows/empty-worksapce-smoke-test-on-minikube-ubi9.yaml
Original file line number Diff line number Diff line change
@@ -26,7 +26,11 @@ env:

jobs:
workspace-api-tests-on-minikube:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm']
runs-on: ${{matrix.runners}}
steps:

- name: Checkout
@@ -47,11 +51,19 @@ jobs:
# remove build-in images from the VM because it is not used
docker rmi -f $(docker images -aq)

- name: Set arch environment variable
run: |
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
echo arch="amd64" >> $GITHUB_ENV
else
echo arch="arm64" >> $GITHUB_ENV
fi

- name: Start minikube cluster
id: run-minikube
uses: che-incubator/setup-minikube-action@next
with:
minikube-version: v1.31.0
run: |
curl -LO https://github.com/kubernetes/minikube/releases/latest/download/minikube-linux-${{env.arch}}
install minikube-linux-${{env.arch}} /usr/local/bin/minikube && rm minikube-linux-${{env.arch}}
minikube start --vm-driver=docker --addons=ingress --cpus 2 --memory 6500

# connect with docker daemon in the minikube and build an image there
# we need to build the image in the minikube because we have just 14 GB of space on the runner
@@ -89,7 +101,7 @@ jobs:
kubectl wait deployment -n devworkspace-controller devworkspace-webhook-server --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT
kubectl wait deployment -n devworkspace-controller devworkspace-controller-manager --for condition=Available=True --timeout=$DEPLOYMENT_TIMEOUT

- name: Check that UDI is presen in the image list
- name: Check that UDI is present in the image list
run: |
# we used it for the build above and do not need it anymore. It saves the disk space
minikube image rm quay.io/devfile/base-developer-image:ubi9-latest
@@ -105,10 +117,134 @@ jobs:
repository: eclipse/che
path: che

# Host devfile locally.
# Use the insiders tag for the che-code image and the PR number for the universal-developer-image
- name: Host devfile locally
run: |
kubectl apply -f - <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: devfile.yaml
data:
devfile.yaml: |
schemaVersion: 2.2.2
metadata:
name: che-code
commands:
- id: init-container-command
apply:
component: che-code-injector
- id: init-che-code-command
exec:
component: che-code-runtime-description
commandLine: nohup /checode/entrypoint-volume.sh > /checode/entrypoint-logs.txt 2>&1 &
events:
preStart:
- init-container-command
postStart:
- init-che-code-command
components:
- name: che-code-injector
container:
image: quay.io/che-incubator/che-code:insiders
command:
- /entrypoint-init-container.sh
volumeMounts:
- name: checode
path: /checode
memoryLimit: 256Mi
memoryRequest: 32Mi
cpuLimit: 500m
cpuRequest: 30m
- name: che-code-runtime-description
container:
image: quay.io/devfile/universal-developer-image:${{ env.PR_NUMBER }}
memoryLimit: 1024Mi
memoryRequest: 256Mi
cpuLimit: 500m
cpuRequest: 30m
volumeMounts:
- name: checode
path: /checode
endpoints:
- name: che-code
attributes:
type: main
cookiesAuthEnabled: true
discoverable: false
urlRewriteSupported: true
targetPort: 3100
exposure: public
secure: true
protocol: https
- name: code-redirect-1
targetPort: 13131
exposure: public
protocol: https
attributes:
discoverable: false
urlRewriteSupported: false
- name: code-redirect-2
targetPort: 13132
exposure: public
protocol: https
attributes:
discoverable: false
urlRewriteSupported: false
- name: code-redirect-3
targetPort: 13133
exposure: public
protocol: https
attributes:
discoverable: false
urlRewriteSupported: false
attributes:
app.kubernetes.io/component: che-code-runtime
app.kubernetes.io/part-of: che-code.eclipse.org
controller.devfile.io/container-contribution: true
- name: checode
volume: {}
---
apiVersion: v1
kind: Pod
metadata:
name: file-server
labels:
app: file-server
spec:
containers:
- name: nginx-container
image: nginx
ports:
- containerPort: 80
volumeMounts:
- name: server-volume
mountPath: /usr/share/nginx/html
readOnly: true
volumes:
- name: server-volume
configMap:
name: devfile.yaml
---
apiVersion: v1
kind: Service
metadata:
name: file-service
spec:
selector:
app: file-server
ports:
- protocol: TCP
port: 80
targetPort: 80
EOF

- name: Run Empty workspace smoke test
run: |
export TS_API_TEST_UDI_IMAGE=quay.io/devfile/universal-developer-image:${{ env.PR_NUMBER }}
export TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI=http://file-service.default.svc:80/devfile.yaml
cd che/tests/e2e
npm i
npm run driver-less-test

138 changes: 138 additions & 0 deletions .github/workflows/pr-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#
# Copyright (c) 2021-2025 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#

name: Pull Request Check

# Trigger the workflow on pull request
on: [pull_request]

jobs:
build-base-image:
name: Build base image
strategy:
fail-fast: false
matrix:
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm']
runs-on: ${{matrix.runners}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set arch environment variable
run: |
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
echo arch="amd64" >> $GITHUB_ENV
else
echo arch="arm64" >> $GITHUB_ENV
fi
- name: Free runner space
run: sudo rm -rf /usr/local/lib/android
- name: Cleanup docker images
run: docker system prune -af
- name: Build base image
run: |
cd base/ubi9 && docker buildx build \
--platform linux/${{env.arch}} \
--progress=plain \
-t base-developer-image-${{env.arch}} .
- name: Display docker images
run: docker images
- name: Compress image to a file
run: docker save base-developer-image-${{env.arch}} | gzip > base-developer-image-${{env.arch}}.tgz
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: base-developer-image-${{env.arch}}
path: base-developer-image-${{env.arch}}.tgz

build-udi:
name: Build udi
strategy:
fail-fast: false
matrix:
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm']
runs-on: ${{matrix.runners}}
needs: build-base-image
steps:
- name: Set arch environment variable
run: |
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
echo arch="amd64" >> $GITHUB_ENV
else
echo arch="arm64" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v4
- name: Free runner space
run: sudo rm -rf /usr/local/lib/android
- name: Cleanup docker images
run: docker system prune -af
- name: Download BDI artifacts
uses: actions/download-artifact@v4
with:
pattern: base-developer-image-*
merge-multiple: true
path: .
- name: List downloaded files
run: ls -lah
- name: Load docker images
run: docker load -i base-developer-image-${{env.arch}}.tgz
- name: Display docker images
run: docker images
- name: Update UDI Dockerfile
run: sed "s|quay.io/devfile/base-developer-image:ubi9-latest|base-developer-image-${{env.arch}}|" -i "universal/ubi9/Dockerfile"
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Build udi
run: |
cd universal/ubi9 && docker buildx build \
--platform linux/${{env.arch}} \
--progress=plain \
--push \
-t quay.io/devfile/universal-developer-image:${{env.arch}}-pr-${{github.event.number}} .

publish-udi:
name: Publish udi
runs-on: ubuntu-22.04
needs: build-udi
steps:
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: publish
run: |
docker manifest create quay.io/devfile/universal-developer-image:pr-${{github.event.number}} \
--amend quay.io/devfile/universal-developer-image:amd64-pr-${{github.event.number}} \
--amend quay.io/devfile/universal-developer-image:arm64-pr-${{github.event.number}}

docker manifest annotate quay.io/devfile/universal-developer-image:pr-${{github.event.number}} \
quay.io/devfile/universal-developer-image:amd64-pr-${{github.event.number}} \
--os linux --arch amd64
docker manifest annotate quay.io/devfile/universal-developer-image:pr-${{github.event.number}} \
quay.io/devfile/universal-developer-image:arm64-pr-${{github.event.number}} \
--os linux --arch arm64

docker manifest push quay.io/devfile/universal-developer-image:pr-${{github.event.number}}
- name: 'Comment PR'
uses: actions/github-script@v7
with:
script: |
const { repo: { owner, repo } } = context;
await github.rest.issues.createComment({
issue_number: ${{github.event.number}},
owner: context.repo.owner,
repo: context.repo.repo,
body: `Pull Request images published ✨\n\nUDI: [quay.io/devfile/universal-developer-image:pr-${{github.event.number}}](https://quay.io/devfile/universal-developer-image:pr-${{github.event.number}})`
})
187 changes: 121 additions & 66 deletions .github/workflows/ubi9-build.yaml
Original file line number Diff line number Diff line change
@@ -17,97 +17,152 @@ on:
description: "The first output string"
value: ${{ jobs.build_universal_ubi9_image.outputs.output1 }}


jobs:
build_base_ubi9_image:
name: Build and publish base ubi9 image to Quay.io
runs-on: ubuntu-22.04
build-base-image:
name: Build base image
strategy:
fail-fast: false
matrix:
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm']
runs-on: ${{matrix.runners}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free runner space
- name: Set arch environment variable
run: |
sudo rm -rf /usr/local/lib/android
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
quay.io/devfile/base-developer-image
flavor: |
latest=true
prefix=ubi9-,onlatest=true
tags: |
type=sha,prefix=ubi9-,format=short
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
echo arch="amd64" >> $GITHUB_ENV
else
echo arch="arm64" >> $GITHUB_ENV
fi
- name: Set short_sha environment variable
run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Free runner space
run: sudo rm -rf /usr/local/lib/android
- name: Cleanup docker images
run: docker system prune -af
- name: Login to Quay.io
uses: docker/login-action@v3
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Docker Build & Push Base
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
provenance: false
context: base/ubi9
platforms: linux/amd64, linux/arm64
tags: |
quay.io/devfile/base-developer-image:latest
${{ steps.meta.outputs.tags }}
- name: Build base image
run: |
cd base/ubi9 && docker buildx build \
--platform linux/${{env.arch}} \
--progress=plain \
--push \
-t quay.io/devfile/base-developer-image:${{env.arch}}-${{env.short_sha}} .
build_universal_ubi9_image:
name: Build and publish universal ubi9 image to Quay.io
publish-base-image:
name: Publish base image
runs-on: ubuntu-22.04
needs: build_base_ubi9_image
# job output for passing to mapping value (the workflow_call section)
outputs:
output1: ${{ steps.setTagName.outputs.uniq_tag }}
needs: build-base-image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free runner space
run: |
sudo rm -rf /usr/local/lib/android
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
- name: Set short_sha environment variable
run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Login to Quay.io
uses: docker/login-action@v3
with:
images: |
quay.io/devfile/universal-developer-image
flavor: |
latest=true
prefix=ubi9-,onlatest=true
tags: |
type=sha,prefix=ubi9-,format=short
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: publish
run: |
for tag in latest ubi9-latest ubi9-${{env.short_sha}};
do
docker manifest create quay.io/devfile/base-developer-image:${tag} \
--amend quay.io/devfile/base-developer-image:amd64-${{env.short_sha}} \
--amend quay.io/devfile/base-developer-image:arm64-${{env.short_sha}}
docker manifest annotate quay.io/devfile/base-developer-image:${tag} \
quay.io/devfile/base-developer-image:amd64-${{env.short_sha}} \
--os linux --arch amd64
docker manifest annotate quay.io/devfile/base-developer-image:${tag} \
quay.io/devfile/base-developer-image:arm64-${{env.short_sha}} \
--os linux --arch arm64
docker manifest push quay.io/devfile/base-developer-image:${tag}
done
build-udi:
name: Build udi
strategy:
fail-fast: false
matrix:
runners: ['ubuntu-22.04', 'ubuntu-22.04-arm']
runs-on: ${{matrix.runners}}
needs: publish-base-image
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set arch environment variable
run: |
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
echo arch="amd64" >> $GITHUB_ENV
else
echo arch="arm64" >> $GITHUB_ENV
fi
- name: Set short_sha environment variable
run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Free runner space
run: sudo rm -rf /usr/local/lib/android
- name: Cleanup docker images
run: docker system prune -af
- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Docker Build & Push Universal
uses: docker/build-push-action@v6
- name: Build udi
run: |
cd universal/ubi9 && docker buildx build \
--platform linux/${{env.arch}} \
--progress=plain \
--push \
-t quay.io/devfile/universal-developer-image:${{env.arch}}-${{env.short_sha}} .
publish-udi:
name: Publish udi
runs-on: ubuntu-22.04
needs: build-udi
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short_sha environment variable
run: echo short_sha="$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
- name: Login to Quay.io
uses: docker/login-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
provenance: false
context: universal/ubi9
tags: |
quay.io/devfile/universal-developer-image:latest
${{ steps.meta.outputs.tags }}
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: publish
run: |
for tag in latest ubi9-latest ubi9-${{env.short_sha}};
do
docker manifest create quay.io/devfile/universal-developer-image:${tag} \
--amend quay.io/devfile/universal-developer-image:amd64-${{env.short_sha}} \
--amend quay.io/devfile/universal-developer-image:arm64-${{env.short_sha}}
docker manifest annotate quay.io/devfile/universal-developer-image:${tag} \
quay.io/devfile/universal-developer-image:amd64-${{env.short_sha}} \
--os linux --arch amd64
docker manifest annotate quay.io/devfile/universal-developer-image:${tag} \
quay.io/devfile/universal-developer-image:arm64-${{env.short_sha}} \
--os linux --arch arm64
docker manifest push quay.io/devfile/universal-developer-image:${tag}
done
- name: Get tag with uniq prefix
id: setTagName
# set the image with uniq tag prefix (for example: quay.io/..../base-developer-image:ubi9-7ad6cab) to env. var
# and define it for output. This output with tag image will be used in caller job
run: |
UNIQ_TAG_IMAGE=$(echo $DOCKER_METADATA_OUTPUT_JSON | jq .tags[0])
echo "...................$UNIQ_TAG_IMAGE"
echo "uniq_tag=$UNIQ_TAG_IMAGE" >> $GITHUB_OUTPUT
echo "uniq_tag=quay.io/devfile/universal-developer-image:ubi9-${{env.short_sha}}" >> $GITHUB_OUTPUT
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -22,3 +22,13 @@ Build with Docker buildkit:
$ cd universal/ubi9
$ DOCKER_BUILDKIT=1 docker image build --progress=plain -t quay.io/devfile/universal-developer-image:ubi9-latest .
```

To build for a specific architecture:

```bash
# amd64
$ DOCKER_BUILDKIT=1 docker image build --platform linux/amd64 --progress=plain -t quay.io/devfile/universal-developer-image:ubi9-latest .

# arm64
$ DOCKER_BUILDKIT=1 docker image build --platform linux/arm64 --progress=plain -t quay.io/devfile/universal-developer-image:ubi9-latest .
```
38 changes: 29 additions & 9 deletions base/ubi9/Dockerfile
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

# https://registry.access.redhat.com/ubi9/ubi
FROM registry.access.redhat.com/ubi9/ubi:9.5-1736404036

ARG TARGETARCH
LABEL maintainer="Red Hat, Inc."

LABEL com.redhat.component="devfile-base-container"
@@ -34,12 +36,13 @@ RUN dnf -y reinstall shadow-utils && \
dnf -y install podman buildah skopeo fuse-overlayfs && \
dnf clean all

## gh-cli
# Download and install gh-cli depending on the architecture.
# See release page for details https://github.com/cli/cli/releases/tag/v2.45.0
RUN \
TEMP_DIR="$(mktemp -d)"; \
cd "${TEMP_DIR}"; \
GH_VERSION="2.45.0"; \
GH_ARCH="linux_amd64"; \
GH_ARCH="linux_$TARGETARCH"; \
GH_TGZ="gh_${GH_VERSION}_${GH_ARCH}.tar.gz"; \
GH_TGZ_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/${GH_TGZ}"; \
GH_CHEKSUMS_URL="https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_checksums.txt"; \
@@ -52,12 +55,17 @@ RUN \
cd -; \
rm -rf "${TEMP_DIR}"

## ripgrep
# Download and install ripgrep depending on the architecture.
# See release page for details https://github.com/BurntSushi/ripgrep/releases/tag/13.0.0
RUN \
TEMP_DIR="$(mktemp -d)"; \
cd "${TEMP_DIR}"; \
RG_VERSION="13.0.0"; \
RG_ARCH="x86_64-unknown-linux-musl"; \
if [ "$TARGETARCH" = "arm64" ]; then \
RG_ARCH="arm-unknown-linux-gnueabihf"; \
else \
RG_ARCH="x86_64-unknown-linux-musl"; \
fi; \
RG_TGZ="ripgrep-${RG_VERSION}-${RG_ARCH}.tar.gz"; \
RG_TGZ_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RG_VERSION}/${RG_TGZ}"; \
curl -sSLO "${RG_TGZ_URL}"; \
@@ -67,12 +75,17 @@ RUN \
cd -; \
rm -rf "${TEMP_DIR}"

## bat
# Download and install bat depending on the architecture.
# See release page for details https://github.com/sharkdp/bat/releases/tag/v0.18.3
RUN \
TEMP_DIR="$(mktemp -d)"; \
cd "${TEMP_DIR}"; \
BAT_VERSION="0.18.3"; \
BAT_ARCH="x86_64-unknown-linux-musl"; \
if [ "$TARGETARCH" = "arm64" ]; then \
BAT_ARCH="aarch64-unknown-linux-gnu"; \
else \
BAT_ARCH="x86_64-unknown-linux-musl"; \
fi; \
BAT_TGZ="bat-v${BAT_VERSION}-${BAT_ARCH}.tar.gz"; \
BAT_TGZ_URL="https://github.com/sharkdp/bat/releases/download/v${BAT_VERSION}/${BAT_TGZ}"; \
curl -sSLO "${BAT_TGZ_URL}"; \
@@ -82,12 +95,17 @@ RUN \
cd -; \
rm -rf "${TEMP_DIR}"

## fd
# Download and install fd depending on the architecture.
# See release page for details https://github.com/sharkdp/fd/releases/tag/v8.7.0
RUN \
TEMP_DIR="$(mktemp -d)" && \
cd "${TEMP_DIR}" && \
FD_VERSION="8.7.0" && \
FD_ARCH="x86_64-unknown-linux-musl" &&\
if [ "$TARGETARCH" = "arm64" ]; then \
FD_ARCH="aarch64-unknown-linux-gnu"; \
else \
FD_ARCH="x86_64-unknown-linux-musl"; \
fi && \
FD_TGZ="fd-v${FD_VERSION}-${FD_ARCH}.tar.gz" && \
FD_TGZ_URL="https://github.com/sharkdp/fd/releases/download/v${FD_VERSION}/${FD_TGZ}" && \
curl -sSLO "${FD_TGZ_URL}" && \
@@ -118,9 +136,11 @@ RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers; \
touch /var/lib/shared/overlay-layers/layers.lock

# Add kubedock
# See release page for details https://github.com/joyrex2001/kubedock/releases/tag/0.17.0
ENV KUBEDOCK_VERSION 0.17.0
ENV KUBECONFIG=/home/user/.kube/config
RUN curl -L https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/kubedock_${KUBEDOCK_VERSION}_linux_amd64.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
RUN KUBEDOCK_ARCH="linux_amd64" && \
curl -L https://github.com/joyrex2001/kubedock/releases/download/${KUBEDOCK_VERSION}/kubedock_${KUBEDOCK_VERSION}_${KUBEDOCK_ARCH}.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
&& chmod +x /usr/local/bin/kubedock
COPY --chown=0:0 kubedock_setup.sh /usr/local/bin/kubedock_setup

47 changes: 33 additions & 14 deletions universal/ubi9/Dockerfile
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

# updateBaseImages.sh can't operate on SHA-based tags as they're not date-based or semver-sequential, and therefore cannot be ordered
FROM quay.io/devfile/base-developer-image:ubi9-latest

ARG TARGETARCH
LABEL maintainer="Red Hat, Inc."

LABEL com.redhat.component="devfile-universal-container"
@@ -21,7 +23,7 @@ USER 0

# $PROFILE_EXT contains all additions made to the bash environment
ENV PROFILE_EXT=/etc/profile.d/udi_environment.sh
RUN touch ${PROFILE_EXT} & chown 10001 ${PROFILE_EXT}
RUN touch ${PROFILE_EXT} && chown 10001 ${PROFILE_EXT}

USER 10001

@@ -57,7 +59,12 @@ ENV JAVA_HOME_21=/home/tooling/.sdkman/candidates/java/21.0.5-tem
ENV SDKMAN_CANDIDATES_API="https://api.sdkman.io/2"
ENV SDKMAN_CANDIDATES_DIR="/home/tooling/.sdkman/candidates"
ENV SDKMAN_DIR="/home/tooling/.sdkman"
ENV SDKMAN_PLATFORM="linuxx64"
RUN if [ "$TARGETARCH" = "arm64" ]; then \
export SDKMAN_PLATFORM="linuxarm64"; \
else \
export SDKMAN_PLATFORM="linuxx64"; \
fi
ENV SDKMAN_PLATFORM=${SDKMAN_PLATFORM}
ENV SDKMAN_VERSION="5.18.2"

ENV GRADLE_HOME="/home/tooling/.sdkman/candidates/gradle/current"
@@ -174,7 +181,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSfo rustup https://sh.rustup.rs && \

# camel-k
ENV KAMEL_VERSION 2.2.0
RUN curl -L https://github.com/apache/camel-k/releases/download/v${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-amd64.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
RUN curl -L https://github.com/apache/camel-k/releases/download/v${KAMEL_VERSION}/camel-k-client-${KAMEL_VERSION}-linux-${TARGETARCH}.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
&& chmod +x /usr/local/bin/kamel

# Config directories
@@ -192,12 +199,16 @@ RUN mkdir -p /home/tooling/.m2 && \

# oc client
ENV OC_VERSION=4.15
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
&& chmod +x /usr/local/bin/oc
RUN if [ "$TARGETARCH" = "arm64" ]; then \
curl -L https://mirror.openshift.com/pub/openshift-v4/arm64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz; \
else \
curl -L https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable-${OC_VERSION}/openshift-client-linux.tar.gz; \
fi | tar -C /usr/local/bin -xz --no-same-owner && \
chmod +x /usr/local/bin/oc

# OS Pipelines CLI (tkn)
ENV TKN_VERSION=1.14.0
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/clients/pipelines/${TKN_VERSION}/tkn-linux-amd64.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
RUN curl -L https://mirror.openshift.com/pub/openshift-v4/clients/pipelines/${TKN_VERSION}/tkn-linux-${TARGETARCH}.tar.gz | tar -C /usr/local/bin -xz --no-same-owner \
&& chmod +x /usr/local/bin/tkn /usr/local/bin/opc /usr/local/bin/tkn-pac

RUN echo 'alias docker=podman' >> ${PROFILE_EXT}
@@ -231,7 +242,11 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
SHELL_CHECK_VERSION="0.8.0"
SHELL_CHECK_ARCH="x86_64"
if [ "$TARGETARCH" = "arm64" ]; then
SHELL_CHECK_ARCH="aarch64"
else
SHELL_CHECK_ARCH="x86_64"
fi
SHELL_CHECK_TGZ="shellcheck-v${SHELL_CHECK_VERSION}.linux.${SHELL_CHECK_ARCH}.tar.xz"
SHELL_CHECK_TGZ_URL="https://github.com/koalaman/shellcheck/releases/download/v${SHELL_CHECK_VERSION}/${SHELL_CHECK_TGZ}"
curl -sSLO "${SHELL_CHECK_TGZ_URL}"
@@ -247,7 +262,7 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
KREW_VERSION="0.4.2"
KREW_ARCH="linux_amd64"
KREW_ARCH="linux_${TARGETARCH}"
KREW_TGZ="krew-${KREW_ARCH}.tar.gz"
KREW_TGZ_URL="https://github.com/kubernetes-sigs/krew/releases/download/v${KREW_VERSION}/${KREW_TGZ}"
curl -sSLO "${KREW_TGZ_URL}"
@@ -276,7 +291,7 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
HELM_VERSION="3.14.3"
HELM_ARCH="linux-amd64"
HELM_ARCH="linux-${TARGETARCH}"
HELM_TGZ="helm-v${HELM_VERSION}-${HELM_ARCH}.tar.gz"
HELM_TGZ_URL="https://get.helm.sh/${HELM_TGZ}"
curl -sSLO "${HELM_TGZ_URL}"
@@ -294,7 +309,7 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
KUSTOMIZE_VERSION="5.3.0"
KUSTOMIZE_ARCH="linux_amd64"
KUSTOMIZE_ARCH="linux_${TARGETARCH}"
KUSTOMIZE_TGZ="kustomize_v${KUSTOMIZE_VERSION}_${KUSTOMIZE_ARCH}.tar.gz"
KUSTOMIZE_TGZ_URL="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/${KUSTOMIZE_TGZ}"
KUSTOMIZE_CHEKSUMS_URL="https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE_VERSION}/checksums.txt"
@@ -313,7 +328,11 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
TKN_VERSION="0.20.0"
TKN_ARCH="Linux_x86_64"
if [ "$TARGETARCH" = "arm64" ]; then
TKN_ARCH="Linux_arm64"
else
TKN_ARCH="Linux_x86_64"
fi
TKN_TGZ="tkn_${TKN_VERSION}_${TKN_ARCH}.tar.gz"
TKN_TGZ_URL="https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/${TKN_TGZ}"
TKN_CHEKSUMS_URL="https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/checksums.txt"
@@ -332,7 +351,7 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
KN_VERSION="1.13.0"
KN_ARCH="linux-amd64"
KN_ARCH="linux-${TARGETARCH}"
KN_BIN="kn-${KN_ARCH}"
KN_BIN_URL="https://github.com/knative/client/releases/download/knative-v${KN_VERSION}/${KN_BIN}"
KN_CHEKSUMS_URL="https://github.com/knative/client/releases/download/knative-v${KN_VERSION}/checksums.txt"
@@ -352,7 +371,7 @@ set -euf -o pipefail
TEMP_DIR="$(mktemp -d)"
cd "${TEMP_DIR}"
TF_VERSION="1.7.5"
TF_ARCH="linux_amd64"
TF_ARCH="linux_${TARGETARCH}"
TF_ZIP="terraform_${TF_VERSION}_${TF_ARCH}.zip"
TF_ZIP_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/${TF_ZIP}"
TF_CHEKSUMS_URL="https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_SHA256SUMS"
@@ -367,7 +386,7 @@ rm -rf "${TEMP_DIR}"
EOF

## skaffold
RUN curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64 && \
RUN curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-${TARGETARCH} && \
install skaffold /usr/local/bin/

# e2fsprogs setup