crlf-docker-entrypoint — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited crlf-docker-entrypoint (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Prevent /bin/sh execution failures caused by Windows CRLF (\r\n) line endings in shell scripts that are copied into Linux-based Docker containers (Alpine, Debian, etc.). The \r character is interpreted as part of the command or flag, producing cryptic errors like illegal option - on set -e.
.sh file on a Windows machine that will be COPY'd or ADD'd into a Docker image.Dockerfile that copies shell scripts from a Windows host into a Linux container.illegal option, not found, or \r related errors from /bin/sh..sh file has CRLF endings. Run file <script>.sh (shows "CRLF" if present) or od -c <script>.sh | head (look for \r\n)..gitattributes in the repository root to force LF on shell scripts: *.sh text eol=lfThen re-checkout the file: git checkout -- <script>.sh.
RUN instruction immediately after the COPY: COPY entrypoint.sh /app/entrypoint.sh
RUN sed -i 's/\r$//' /app/entrypoint.shsed -i 's/\r$//' <script>.sh on the host before docker build.Always prefer the .gitattributes approach because it prevents the problem at the root for all contributors.
/bin/sh: illegal option - when the container runs set -e from an entrypoint script.exec format error or not found on scripts with a shebang line containing a trailing \r.\r corrupts variable values or command arguments.set -e as a workaround for the CRLF issue; the real fix is correcting line endings.sed; only target .sh and other text-based scripts..gitattributes over Dockerfile sed to keep the fix version-controlled and automatic.files.eol), as they do not protect against other tools or contributors..sh file reports ASCII text (not ASCII text, with CRLF line terminators) when inspected with file./bin/sh errors related to line endings..gitattributes entry exists for *.sh with text eol=lf..sh files still have LF endings.Scenario: A docker-entrypoint.sh is created on Windows with VS Code (default CRLF). The Dockerfile copies it in and sets it as ENTRYPOINT. On docker run, the container exits immediately with:
/bin/sh: illegal option -Diagnosis: docker run --rm --entrypoint cat myimage /app/docker-entrypoint.sh | od -c | head reveals \r\n sequences.
Fix applied:
.gitattributes: *.sh text eol=lf git add --renormalize docker-entrypoint.sh
git commit -m "fix: force LF endings on shell scripts"Scenario: A developer runs docker build on macOS (which uses LF natively) and everything works. CI runs on a Windows runner with Git configured as core.autocrlf=true. The checkout converts .sh files to CRLF. The Docker build succeeds (no syntax check at build time), but the container crashes at runtime.
Diagnosis: The CI log shows the container exiting with code 2. Adding RUN cat -A /app/entrypoint.sh to the Dockerfile reveals lines ending with ^M$ instead of just $.
Fix applied:
.gitattributes with *.sh text eol=lf (this overrides core.autocrlf for matching files).RUN sed -i 's/\r$//' /app/entrypoint.sh in the Dockerfile as a belt-and-suspenders measure for environments where .gitattributes might be bypassed.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.