-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix Docker build failing on Windows (#4488) #4509
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
base: main
Are you sure you want to change the base?
Conversation
Greptile OverviewGreptile SummaryThis PR fixes Docker build failures on Windows by addressing line ending issues with shell scripts. It implements a two-layer defense: Key Changes:
The fix is minimal, well-targeted, and follows best practices for cross-platform compatibility. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant WinDev as Windows Developer
participant Git as Git (Windows)
participant Repo as Repository
participant Docker as Docker Build
participant Container as Linux Container
Note over WinDev,Git: Before Fix
WinDev->>Git: git clone/checkout
Git->>WinDev: .sh files with CRLF
WinDev->>Docker: docker build
Docker->>Container: COPY .sh files (with CRLF)
Container->>Container: Execute .sh scripts
Note over Container: ❌ Fails: /bin/bash: bad interpreter: ^M
Note over WinDev,Container: After Fix
WinDev->>Git: git clone/checkout
Note over Git: .gitattributes enforces LF for *.sh
Git->>WinDev: .sh files with LF
WinDev->>Docker: docker build
Docker->>Container: COPY .sh files
Note over Container: Defense: find + sed removes any \r
Container->>Container: chmod +x isaaclab.sh
Container->>Container: Execute .sh scripts
Note over Container: ✓ Success: Scripts execute properly
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, no comments
On Windows, when IsaacLab is checked out from a repo with Git installed from Windows installer with default settings for line endings handling, docker container fails to build. This fixes it by setting rule for .sh files in .gitattributes and replacing damaged line endings when building docker.
Fixes # (issue)
#4488
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there