From c263793fb252bf489bb6929be109f2a3c6ffbcaa Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sun, 16 Aug 2026 20:18:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker):=20=E5=BC=BA=E5=88=B6=20Dockerfile/?= =?UTF-8?q?shell=20=E6=96=87=E4=BB=B6=20LF=20=E8=A1=8C=E5=B0=BE,=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=AE=B9=E5=99=A8=E5=85=A5=E5=8F=A3=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dockerfile.trading 用 BuildKit heredoc 内嵌生成 rakuten-entrypoint.sh, Windows 签出(core.autocrlf)把 Dockerfile 转成 CRLF 后,heredoc 内容 继承 CR,shebang 变成 /bin/sh\r,容器启动报 "exec /usr/local/bin/rakuten-entrypoint.sh failed: No such file or directory" (实际是解释器 /bin/sh\r 不存在)。 - 新增 .gitattributes:Dockerfile*、*.sh、*.py、*.yaml、*.toml、*.json 强制 eol=lf,杜绝 Windows 签出再次转坏 - Dockerfile / Dockerfile.trading 工作区文件转回 LF --- .gitattributes | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b182a4d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Windows 签出(core.autocrlf)会把文本文件转成 CRLF。 +# Dockerfile.trading 内嵌 heredoc 生成 shell 入口脚本,CRLF 会让 shebang +# 变成 /bin/sh\r,容器启动报 "No such file or directory"。以下文件强制 LF: +Dockerfile* text eol=lf +*.sh text eol=lf +*.py text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.toml text eol=lf +*.json text eol=lf