Skip to content

FIX: Add arm64 Support for devcontainer#1409

Open
spencrr wants to merge 1 commit intoAzure:mainfrom
spencrr:spencrr/fix-arm-devcontainer
Open

FIX: Add arm64 Support for devcontainer#1409
spencrr wants to merge 1 commit intoAzure:mainfrom
spencrr:spencrr/fix-arm-devcontainer

Conversation

@spencrr
Copy link

@spencrr spencrr commented Feb 27, 2026

Description

Fixes the devcontainer to support both amd64 and arm64 architectures. Previously, the Dockerfile and docker-compose.yml hardcoded linux/amd64, which caused issues on ARM-based machines.

Changes

  • Removed --platform=linux/amd64 from the FROM instruction in .devcontainer/Dockerfile so Docker uses the host's native architecture.
  • Removed platform: linux/amd64 from .devcontainer/docker-compose.yml.
  • Made the Microsoft apt repo arch-aware by replacing the hardcoded arch=amd64 with arch=$(dpkg --print-architecture).
  • Conditionally installed MSSQL tools (msodbcsql18, mssql-tools, unixodbc-dev) only on amd64, since these packages are not available for arm64.
  • Added Rust toolchain installation (rustup) to support Python packages that require Rust compilation (needed on arm64 where some wheels are not pre-built).

Tests and Documentation

  • No test or documentation changes required; this is an infrastructure/devcontainer-only change.
  • Verified the devcontainer builds and starts successfully on arm64.

@spencrr spencrr self-assigned this Feb 27, 2026
Copilot AI review requested due to automatic review settings February 27, 2026 00:42
@spencrr
Copy link
Author

spencrr commented Feb 27, 2026

@microsoft-github-policy-service agree company="Microsoft"

@spencrr spencrr force-pushed the spencrr/fix-arm-devcontainer branch from a51c9c0 to 6f8ad74 Compare February 27, 2026 00:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the devcontainer configuration to build and run on both amd64 and arm64 hosts by removing hardcoded amd64 platform targeting and making Microsoft repo/package installation architecture-aware.

Changes:

  • Removed linux/amd64 platform pinning from the devcontainer Dockerfile and docker-compose configuration.
  • Made the Microsoft apt repo entry use the host architecture and installed MSSQL tooling only on amd64.
  • Added Rust toolchain installation to support building Python dependencies on platforms without prebuilt wheels (e.g., arm64).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.devcontainer/docker-compose.yml Removes amd64-only platform pin so Compose uses the native host architecture.
.devcontainer/Dockerfile Removes amd64-only base image constraint; makes Microsoft apt repo arch-aware; conditionally installs MSSQL tools; adds Rust toolchain.

mssql-tools \
unixodbc-dev \
&& if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools unixodbc-dev \
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unixodbc-dev is already installed earlier in the Dockerfile, but it’s included again in the amd64-only install list here. This is redundant and slows builds; consider dropping unixodbc-dev from this conditional install (or removing the earlier unconditional install if you truly only want it on amd64).

Suggested change
ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools unixodbc-dev \
ACCEPT_EULA=Y apt-get install -y msodbcsql18 mssql-tools \

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +56
# Install Rust toolchain
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust is installed under /root via rustup and PATH is set to /root/.cargo/bin, but the container later switches to USER vscode. Since /root is typically not traversable by non-root users, cargo/rustc will likely be unavailable when postCreate runs uv pip install ... as vscode. Install Rust in a location accessible to vscode (e.g., install rustup as the vscode user or set CARGO_HOME/RUSTUP_HOME under /usr/local or /opt with appropriate permissions). Also avoid the curl | sh pipeline without pipefail/checksum verification; a curl failure can be masked and leave Rust uninstalled while the build still succeeds.

Suggested change
# Install Rust toolchain
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Install Rust toolchain into a shared location accessible to all users
ENV RUSTUP_HOME="/usr/local/rustup"
ENV CARGO_HOME="/usr/local/cargo"
RUN set -euo pipefail \
&& mkdir -p "${RUSTUP_HOME}" "${CARGO_HOME}" \
&& chmod -R 0755 "${RUSTUP_HOME}" "${CARGO_HOME}" \
&& curl -sSf https://sh.rustup.rs -o /tmp/rustup-init.sh \
&& sh /tmp/rustup-init.sh -y --no-modify-path \
&& rm -f /tmp/rustup-init.sh
ENV PATH="/usr/local/cargo/bin:${PATH}"

Copilot uses AI. Check for mistakes.
&& rm -rf /var/lib/apt/lists/*

# Install Rust toolchain
RUN curl -sSf https://sh.rustup.rs | sh -s -- -y
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The curl pipeline that executes https://sh.rustup.rs via sh introduces a supply chain risk by running remote, unauthenticated code as part of the image build. If the remote endpoint or the connection is compromised, an attacker could execute arbitrary code in the devcontainer build context, potentially accessing checked-out source and developer credentials mounted into the container. Prefer installing Rust via a pinned package or, if you must use this installer, download the script with a fixed version and verify its integrity (e.g., checksum/signature) before execution instead of piping it directly to sh.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants