Add aarch64 support to DevContainer#29
Conversation
This has aarch64 support, finally.
e403cb2 to
e14fb7c
Compare
This method should support aarch64 as well.
more convenient
There was a problem hiding this comment.
is this still needed when bazelisk is there?
There was a problem hiding this comment.
at least if you want that the command is ready right after container start...
There was a problem hiding this comment.
UPDATE fixed with pushed commit
I cannot build the container locally anymore
node ➜ /workspaces/devcontainer (aarch64_support) $ ./scripts/build.sh
+ devcontainer build --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name ghcr.io/eclipse-score/devcontainer:latest --cache-from ghcr.io/eclipse-score/devcontainer
[8 ms] @devcontainers/cli 0.80.1. Node.js v18.16.0. linux 6.8.0-85-generic x64.
[233 ms] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/git'...
[1151 ms] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/git-lfs'...
[1661 ms] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/common-utils'...
[1969 ms] Resolving Feature dependencies for 'ghcr.io/devcontainers-community/features/llvm'...
[2484 ms] Resolving Feature dependencies for 'ghcr.io/devcontainers/features/python'...
[3396 ms] Resolving Feature dependencies for './s-core-local'...
[4530 ms] Soft-dependency 'ghcr.io/devcontainers/features/oryx' is not required. Removing from installation order...
[5084 ms] Files to omit: ''
[5410 ms] Files to omit: ''
[5732 ms] Files to omit: ''
[6169 ms] Files to omit: ''
[6465 ms] Files to omit: ''
[6495 ms] Start: Run: docker buildx build --platform linux/aarch64 --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-node/container-features/0.80.1-1759834125199/Dockerfile-with-features -t ghcr.io/eclipse-score/devcontainer:latest --target dev_containers_target_stage --cache-from ghcr.io/eclipse-score/devcontainer --build-context dev_containers_feature_content_source=/tmp/devcontainercli-node/container-features/0.80.1-1759834125199 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /workspaces/devcontainer/src/s-core-devcontainer/.devcontainer
[+] Building 2.6s (10/21) docker:default
=> [internal] load build definition from Dockerfile-with-features 0.0s
=> => transferring dockerfile: 8.18kB 0.0s
=> resolve image config for docker-image://docker.io/docker/dockerfile:1.4 1.5s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b17e94c4e84ced81e24ef1a0dbc 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/buildpack-deps:noble-curl 0.7s
=> [context dev_containers_feature_content_source] load .dockerignore 0.0s
=> => transferring dev_containers_feature_content_source: 2B 0.0s
=> importing cache manifest from ghcr.io/eclipse-score/devcontainer 0.0s
=> [context dev_containers_feature_content_source] load from client 0.0s
=> => transferring dev_containers_feature_content_source: 197.97kB 0.0s
=> CACHED [dev_container_auto_added_stage_label 1/2] FROM docker.io/library/buildpack-deps:noble-curl@sha256:5b15b704c070d22e7c07f71f69ba1c 0.0s
=> ERROR [dev_container_auto_added_stage_label 2/2] RUN if [ "noble" = "noble" ]; then if id "ubuntu" &>/dev/null; then 0.2s
------
> [dev_container_auto_added_stage_label 2/2] RUN if [ "noble" = "noble" ]; then if id "ubuntu" &>/dev/null; then echo "Deleting user 'ubuntu' for noble" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user for noble"; else echo "User 'ubuntu' does not exist for noble"; fi; fi:
0.145 exec /bin/sh: exec format error
------
ERROR: failed to build: failed to solve: process "/bin/sh -c if [ \"$VARIANT\" = \"noble\" ]; then if id \"ubuntu\" &>/dev/null; then echo \"Deleting user 'ubuntu' for $VARIANT\" && userdel -f -r ubuntu || echo \"Failed to delete ubuntu user for $VARIANT\"; else echo \"User 'ubuntu' does not exist for $VARIANT\"; fi; fi" did not complete successfully: exit code: 255
Error: Command failed: docker buildx build --platform linux/aarch64 --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-node/container-features/0.80.1-1759834125199/Dockerfile-with-features -t ghcr.io/eclipse-score/devcontainer:latest --target dev_containers_target_stage --cache-from ghcr.io/eclipse-score/devcontainer --build-context dev_containers_feature_content_source=/tmp/devcontainercli-node/container-features/0.80.1-1759834125199 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /workspaces/devcontainer/src/s-core-devcontainer/.devcontainer
at F6 (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:468:1988)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async pw (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:467:1886)
at async k7 (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:667:2203)
at async R7 (/usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:666:4937)
at async /usr/local/share/npm-global/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:484:1188
{"outcome":"error","message":"Command failed: docker buildx build --platform linux/aarch64 --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-node/container-features/0.80.1-1759834125199/Dockerfile-with-features -t ghcr.io/eclipse-score/devcontainer:latest --target dev_containers_target_stage --cache-from ghcr.io/eclipse-score/devcontainer --build-context dev_containers_feature_content_source=/tmp/devcontainercli-node/container-features/0.80.1-1759834125199 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /workspaces/devcontainer/src/s-core-devcontainer/.devcontainer","description":"An error occurred building the image."}
scripts/publish.sh
Outdated
| devcontainer build --push --platform linux/aarch64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer | ||
| devcontainer build --push --platform linux/amd64 --workspace-folder src/s-core-devcontainer --image-name "ghcr.io/eclipse-score/devcontainer:${TAG}" --cache-from ghcr.io/eclipse-score/devcontainer |
There was a problem hiding this comment.
what is now the plan to update the latest tag? I was expecting that latest always points to the last release, which is not the case anymore.
There was a problem hiding this comment.
agreed tags in discussion
- latest points to last released
<version> - main points to state of most recent commit in main branch
<version>points to container build from git tag that has been deemed releasable
There was a problem hiding this comment.
ensure: devcontainer build must use the lockfile, not update it silently
There was a problem hiding this comment.
local test showed that modifying hashes in the lock file resulted in an build error. After I reverted my changes, the build worked again
There was a problem hiding this comment.
agreed tags in discussion
- latest points to last released
<version>- main points to state of most recent commit in main branch
<version>points to container build from git tag that has been deemed releasable
Done like that
| "ghcr.io/devcontainers/features/git-lfs", | ||
| "ghcr.io/devcontainers/features/common-utils", | ||
| "ghcr.io/devcontainers-community/features/llvm", | ||
| "ghcr.io/devcontainers/features/python", |
…ntainer versioning
Has this been fixed meanwhile? I still get the error. |
With this change, in addition to the
amd64(x86_64) container, anaarch64container is built. This should be useful for anyone using e.g. an Apple-M-series-based computer. Also, thelatesttag is now updated along with the tag builds created from Git tags. Themaintag is now used for tracking builds created from the main Git branch.Closes #23