fix: resolve heredoc parsing error in deploy-oci #7

Merged
fam merged 1 commits from fix/deploy-oci-dockerfile into master 2026-04-09 20:32:24 +00:00
Owner

问题

Makefile 第 43 行用 heredoc 通过 SSH 生成 Dockerfile,但 make recipe 里行尾的 \ 是续行符,\n\ 这个组合导致整个 heredoc 被展开成一行传给远端 shell。远端收到的是 <<DEOF\nFROM...,把 DEOF\nFROM 当成了 heredoc 结束符,所以报:

bash: line 14: warning: here-document at line 14 delimited by end-of-file (wanted 'DEOFnFROM')
cat: unrecognized option '--no-cache'

修法

把内联的 Dockerfile 提取成独立的 Dockerfile.oci,直接 scp 过去,干净利落,不再有 heredoc 转义问题。

## 问题 Makefile 第 43 行用 heredoc 通过 SSH 生成 Dockerfile,但 make recipe 里行尾的 `\` 是续行符,`\n\` 这个组合导致整个 heredoc 被展开成**一行**传给远端 shell。远端收到的是 `<<DEOF\nFROM...`,把 `DEOF\nFROM` 当成了 heredoc 结束符,所以报: ``` bash: line 14: warning: here-document at line 14 delimited by end-of-file (wanted 'DEOFnFROM') cat: unrecognized option '--no-cache' ``` ## 修法 把内联的 Dockerfile 提取成独立的 `Dockerfile.oci`,直接 `scp` 过去,干净利落,不再有 heredoc 转义问题。
ms added 1 commit 2026-04-07 09:54:45 +00:00
Extract inline Dockerfile to Dockerfile.oci and scp it instead of
generating it via heredoc over SSH. Make's line-continuation backslash
was causing the heredoc delimiter to be parsed as 'DEOFnFROM' by the
remote shell, breaking the image build step.
fam merged commit f298e4a2a6 into master 2026-04-09 20:32:24 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: euphon/repo-vis#7