Skip to content

Fix Docker build issues on Windows and non-ARM architectures#61

Closed
EmilLindfors wants to merge 2 commits intoanthropics:mainfrom
EmilLindfors:win11_fixes
Closed

Fix Docker build issues on Windows and non-ARM architectures#61
EmilLindfors wants to merge 2 commits intoanthropics:mainfrom
EmilLindfors:win11_fixes

Conversation

@EmilLindfors
Copy link
Copy Markdown

Problem

The current .devcontainer setup encounters two major issues when building on Windows or non-ARM architectures:

The Dockerfile attempts to install git-delta specifically for ARM64 architecture, causing build failures on x86_64 systems.
Windows line endings (CRLF) in shell scripts cause script execution failures within the Linux container.

Changes

Modified the Dockerfile to detect system architecture and install the appropriate version of git-delta (ARM64 vs AMD64)
Added a .gitattributes file to enforce LF line endings for all text files, with special attention to shell scripts
Ensured script files have proper executable permissions

Testing

Successfully built and ran the dev container on Windows 11 with Docker Desktop.
These changes maintain compatibility with ARM-based systems while adding support for the more common x86_64 architecture, making Claude Code more accessible to developers using standard hardware.

nb. unfortunately claude-code is at capacity so i cant test the actual application

8enmann
8enmann previously approved these changes Feb 25, 2025
Copy link
Copy Markdown
Collaborator

@8enmann 8enmann left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Unfortunately we require signed commits so I think you'll need to rebase & force push. https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

… appropriate version of git-delta (ARM64 vs AMD64)

Added a .gitattributes file to enforce LF line endings for all text files, with special attention to shell scripts
Ensured script files have proper executable permissions
@w-duffy
Copy link
Copy Markdown

w-duffy commented Feb 25, 2025

@EmilLindfors I like the approach for handling amd64 and arm64, but I think this might be a safer and more dynamic solution:

RUN ARCH=$(dpkg --print-architecture) && \
  wget "https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_${ARCH}.deb" && \
  sudo dpkg -i "git-delta_0.18.2_${ARCH}.deb" && \
  rm "git-delta_0.18.2_${ARCH}.deb"

It uses dpkg --print-architecture to grab the exact Debian architecture and builds the URL dynamically. That way, it’s simpler (no conditionals) and can handle any architecture without hardcoding. It also avoids assuming amd64 as a fallback, which could break on edge cases (like 32-bit x86 systems).

What do you think?

@EmilLindfors
Copy link
Copy Markdown
Author

thanks for the great suggestion @w-duffy, agreed. I created a new pr #91 due to the chaos i invoked by trying to sign, rebase and force push.

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.

3 participants