When creating the devcontainer on M-series Macs (arm64), .devcontainer/install-deps.sh fails during apt-get install because it unconditionally installs gcc-multilib and g++-multilib, which are not available in apt arm64/aarch64 repos.
This blocks devcontainer-based development on Apple Silicon without using Rosetta/emulation.
Environment
-
Host: Apple Silicon MacBook (any M-series)
-
Container base: Ubuntu (Noble)
-
Arch inside container: arm64 / aarch64
dotwee@macbook ~ % docker run --rm -it ubuntu uname -m
aarch64
-
Devcontainer config: .devcontainer/docker/devcontainer.json
-
Bootstrap script: .devcontainer/install-deps.sh
Reproduction
- Open repo in Dev Containers on an Apple Silicon Mac.
- Let
onCreateCommand run .devcontainer/install-deps.sh.
- Observe apt failure for multilib packages.
Actual result
Devcontainer creation fails with:
E: Unable to locate package g++-multilib
E: Package 'gcc-multilib' has no installation candidate
Log for reference:
...
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package gcc-multilib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Unable to locate package g++-multilib
E: Couldn't find any package by regex 'g++-multilib'
E: Package 'gcc-multilib' has no installation candidate
Expected result
Well, the devcontainer should initialize successfully on both amd64 and arm64.
Root cause
gcc-multilib and g++-multilib are x86-oriented packages and are not published for Ubuntu arm64 in this setup.
When creating the devcontainer on M-series Macs (
arm64),.devcontainer/install-deps.shfails duringapt-get installbecause it unconditionally installsgcc-multilibandg++-multilib, which are not available in aptarm64/aarch64repos.This blocks devcontainer-based development on Apple Silicon without using Rosetta/emulation.
Environment
Host: Apple Silicon MacBook (any M-series)
Container base: Ubuntu (Noble)
Arch inside container:
arm64/aarch64dotwee@macbook ~ % docker run --rm -it ubuntu uname -m aarch64Devcontainer config:
.devcontainer/docker/devcontainer.jsonBootstrap script:
.devcontainer/install-deps.shReproduction
onCreateCommandrun.devcontainer/install-deps.sh.Actual result
Devcontainer creation fails with:
E: Unable to locate package g++-multilibE: Package 'gcc-multilib' has no installation candidateLog for reference:
Expected result
Well, the devcontainer should initialize successfully on both
amd64andarm64.Root cause
gcc-multilibandg++-multilibare x86-oriented packages and are not published for Ubuntuarm64in this setup.