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

DevContainer on Apple Silicon/arm64 systems does not work #12704

Open
1 task done
mtwilliams-code opened this issue Dec 10, 2024 · 1 comment
Open
1 task done

DevContainer on Apple Silicon/arm64 systems does not work #12704

mtwilliams-code opened this issue Dec 10, 2024 · 1 comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)

Comments

@mtwilliams-code
Copy link
Contributor

mtwilliams-code commented Dec 10, 2024

Astro Info

n/a. Commit 6f4793656e6c911525c95afa570ca4a19ba11a3c in Astro repo.

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Trying to start the contribute to Astro dev container on apple silicon fails with a timeout on the vscode side because the docker container fails to build. The docker build log shows it fails on step 5:

11  RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
12    && curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_$(dpkg --print-architecture).deb -o /tmp/chrome.deb \
13    && apt-get -y install /tmp/chrome.deb

with error

Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Get:4 http://deb.debian.org/debian bookworm/main arm64 Packages [8688 kB]
Get:5 http://deb.debian.org/debian bookworm-updates/main arm64 Packages [2708 B]
Get:6 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [203 kB]
Fetched 9148 kB in 3s (3020 kB/s)
Reading package lists...
Reading package lists...E: Invalid archive signature
E: Internal error, could not locate member control.tar{.zst,.lz4,.gz,.xz,.bz2,.lzma,}
E: Could not read meta data from /tmp/chrome.deb
E: The package lists or status file could not be parsed or opened.

It seems docker builds the image to match the host architecture and Google does not publish a Linux arm64 package of chrome.

What's the expected result?

It should build successfully and run on Apple Silicon and other Arm64 architecture machines.

We could modify the root dev container config to force it to build to amd64(ie x86) and transparently emulate with Rosetta on modern Docker setups by adding a platform argument. I don't believe this will have any impact on GitHub codespaces or other devcontainer spec using containerized dev environments, as they seem to all run on amd64 already.

diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 6b8edf605..ec38b8659 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -1,8 +1,10 @@
 {
   "name": "Contribute to Astro",
   "build": {
-    "dockerfile": "Dockerfile"
+    "dockerfile": "Dockerfile",
+    "options": ["--platform=linux/amd64"]
   },
+  "runArgs": ["--platform=linux/amd64"],
 
   "features": {
     "ghcr.io/devcontainers/features/desktop-lite:1": {}

Link to Minimal Reproducible Example

to reproduce clone astro on an arm64 machine and try to use the vscode dev containers extension to start the "Contribute to Astro" dev container with the "Dev Containers: Open Folder in Container..." command.

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 10, 2024
@ematipico ematipico added the - P2: nice to have Not breaking anything but nice to have (priority) label Dec 10, 2024
@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Dec 10, 2024
@bluwy
Copy link
Member

bluwy commented Jan 2, 2025

@bdmac since you've updated the devcontainers configuration before (#6288), do you have thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

3 participants