-
Notifications
You must be signed in to change notification settings - Fork 6
Use ARM64 and AMD64 Builders #56
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
Merged
AlexanderLanin
merged 1 commit into
eclipse-score:main
from
elektrobit-contrib:use-arm64-builder
Nov 24, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,44 @@ | ||
| #!/usr/bin/env bash | ||
| set -euxo pipefail | ||
|
|
||
| if [ "$#" -eq 0 ]; then | ||
| echo "Error: At least one parameter (label) must be provided." | ||
| if [[ "$#" -lt 1 || "$1" != "--arm64" && "$1" != "--amd64" ]]; then | ||
| echo "Error: First parameter must be --arm64 or --amd64." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ "$#" -lt 2 ]; then | ||
| echo "Error: At least one label must be provided after the architecture option." | ||
| exit 1 | ||
| fi | ||
|
|
||
| ARCH_OPTION="$1" | ||
| shift | ||
|
|
||
| ARCH="amd64" | ||
| if [[ "$ARCH_OPTION" == "--arm64" ]]; then | ||
| ARCH="arm64" | ||
| fi | ||
|
|
||
| LABELS=() | ||
| for LABEL in "$@"; do | ||
| LABELS+=("${LABEL}") | ||
| done | ||
|
|
||
| # Define target architectures | ||
| ARCHITECTURES=("amd64" "arm64") | ||
|
|
||
| # Build for each architecture, creating all requested tags | ||
| for ARCH in "${ARCHITECTURES[@]}"; do | ||
| echo "Building all labels (${LABELS[@]}) for architecture: ${ARCH}" | ||
|
|
||
| # Prepare image names with tags (each tag includes a label and an architecture) | ||
| IMAGES=() | ||
| for LABEL in "${LABELS[@]}"; do | ||
| IMAGES+=("--image-name \"ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}\"") | ||
| done | ||
| echo "Building all labels (${LABELS[@]}) for architecture: ${ARCH}" | ||
|
|
||
| # Prepare devcontainer build command | ||
| DEVCONTAINER_CALL="devcontainer build --workspace-folder src/s-core-devcontainer --cache-from ghcr.io/eclipse-score/devcontainer" | ||
| # Prepare image names with tags (each tag includes a label and the architecture) | ||
| IMAGES=() | ||
| for LABEL in "${LABELS[@]}"; do | ||
| IMAGES+=("--image-name \"ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}\"") | ||
| done | ||
|
|
||
| # Append image names to the build command | ||
| for IMAGE in "${IMAGES[@]}"; do | ||
| DEVCONTAINER_CALL+=" $IMAGE" | ||
| done | ||
| # Prepare devcontainer build command | ||
| DEVCONTAINER_CALL="devcontainer build --workspace-folder src/s-core-devcontainer --cache-from ghcr.io/eclipse-score/devcontainer" | ||
|
|
||
| # Execute the build for the specific architecture | ||
| eval "$DEVCONTAINER_CALL --platform linux/${ARCH}" | ||
| # Append image names to the build command | ||
| for IMAGE in "${IMAGES[@]}"; do | ||
| DEVCONTAINER_CALL+=" $IMAGE" | ||
| done | ||
|
|
||
| # Execute the build for the specific architecture | ||
| eval "$DEVCONTAINER_CALL --platform linux/${ARCH}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #!/usr/bin/env bash | ||
| set -euxo pipefail | ||
|
|
||
| if [ "$#" -eq 0 ]; then | ||
| echo "Error: At least one parameter (label) must be provided." | ||
| exit 1 | ||
| fi | ||
|
|
||
| LABELS=() | ||
| for LABEL in "$@"; do | ||
| LABELS+=("${LABEL}") | ||
| done | ||
|
|
||
| # Define target architectures | ||
| ARCHITECTURES=("amd64" "arm64") | ||
|
|
||
| # Pull all architecture-specific images for each label | ||
| for LABEL in "${LABELS[@]}"; do | ||
| for ARCH in "${ARCHITECTURES[@]}"; do | ||
| docker pull --platform "linux/${ARCH}" "ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}" | ||
| done | ||
| done | ||
|
|
||
| # Create and push the merged multiarch manifest for each tag; each tag combines all architecture-specific tags into one tag | ||
| for LABEL in "${LABELS[@]}"; do | ||
| echo "Merging all architectures (${ARCHITECTURES[@]}) into single tag: ${LABEL}" | ||
|
|
||
| MANIFEST_MERGE_CALL="docker buildx imagetools create -t ghcr.io/eclipse-score/devcontainer:${LABEL}" | ||
|
|
||
| for ARCH in "${ARCHITECTURES[@]}"; do | ||
| MANIFEST_MERGE_CALL+=" ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}" | ||
| done | ||
|
|
||
| eval "$MANIFEST_MERGE_CALL" | ||
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,50 +1,43 @@ | ||
| #!/usr/bin/env bash | ||
| set -euxo pipefail | ||
|
|
||
| if [ "$#" -eq 0 ]; then | ||
| echo "Error: At least one parameter (label) must be provided." | ||
| if [[ "$#" -lt 1 || "$1" != "--arm64" && "$1" != "--amd64" ]]; then | ||
| echo "Error: First parameter must be --arm64 or --amd64." | ||
| exit 1 | ||
| fi | ||
|
|
||
| LABELS=() | ||
| for LABEL in "$@"; do | ||
| LABELS+=("${LABEL}") | ||
| done | ||
|
|
||
| # Define target architectures | ||
| ARCHITECTURES=("amd64" "arm64") | ||
|
|
||
| # Build and push for each architecture, creating all requested tags | ||
| for ARCH in "${ARCHITECTURES[@]}"; do | ||
| echo "Building all tags (${LABELS[@]}) for architecture: ${ARCH}" | ||
|
|
||
| # Prepare image names with tags (each tag includes a label and an architecture) | ||
| IMAGES=() | ||
| for LABEL in "${LABELS[@]}"; do | ||
| IMAGES+=("--image-name \"ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}\"") | ||
| done | ||
| if [ "$#" -lt 2 ]; then | ||
| echo "Error: At least one label must be provided after the architecture option." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Prepare devcontainer build command | ||
| DEVCONTAINER_CALL="devcontainer build --push --workspace-folder src/s-core-devcontainer --cache-from ghcr.io/eclipse-score/devcontainer" | ||
| ARCH_OPTION="$1" | ||
| shift | ||
|
|
||
| # Append image names to the build command | ||
| for IMAGE in "${IMAGES[@]}"; do | ||
| DEVCONTAINER_CALL+=" $IMAGE" | ||
| done | ||
| ARCH="amd64" | ||
| if [[ "$ARCH_OPTION" == "--arm64" ]]; then | ||
| ARCH="arm64" | ||
| fi | ||
|
|
||
| # Execute the build and push all tags for the specific architecture | ||
| eval "$DEVCONTAINER_CALL --platform linux/${ARCH}" | ||
| LABELS=() | ||
| for LABEL in "$@"; do | ||
| LABELS+=("${LABEL}") | ||
| done | ||
|
|
||
| # Create and push the merged multiarch manifest for each tag; each tag combines all architecture-specific tags into one tag | ||
| echo "Building all tags (${LABELS[@]}) for architecture: ${ARCH}" | ||
| # Prepare image names with tags (each tag includes a label and an architecture) | ||
| IMAGES=() | ||
| for LABEL in "${LABELS[@]}"; do | ||
| echo "Merging all architectures (${ARCHITECTURES[@]}) into single tag: ${LABEL}" | ||
|
|
||
| MANIFEST_MERGE_CALL="docker buildx imagetools create -t ghcr.io/eclipse-score/devcontainer:${LABEL}" | ||
| IMAGES+=("--image-name \"ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}\"") | ||
| done | ||
|
|
||
| for ARCH in "${ARCHITECTURES[@]}"; do | ||
| MANIFEST_MERGE_CALL+=" ghcr.io/eclipse-score/devcontainer:${LABEL}-${ARCH}" | ||
| done | ||
| # Prepare devcontainer build command | ||
| DEVCONTAINER_CALL="devcontainer build --push --workspace-folder src/s-core-devcontainer --cache-from ghcr.io/eclipse-score/devcontainer" | ||
|
|
||
| eval "$MANIFEST_MERGE_CALL" | ||
| # Append image names to the build command | ||
| for IMAGE in "${IMAGES[@]}"; do | ||
| DEVCONTAINER_CALL+=" $IMAGE" | ||
| done | ||
|
|
||
| # Execute the build and push all tags for the specific architecture | ||
| eval "$DEVCONTAINER_CALL --platform linux/${ARCH}" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to manually login, since you have the login action above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes, but I can double-check next time I create a PR.