strace 表明,与 shell 形式相比,我使用的转义可能会导致问题(shell 形式与 exec 形式请参阅https://docs.docker.com/engine/reference/builder/)
带有 [/* 3 vars */] 的 exec 形式 - 中断/制造麻烦
ENTRYPOINT ["strace", "hugo", "server", "--watch=true", "--bind=0.0.0.0", "--source=\"/src\"", "--destination=\"/output\""]
execve("hugo", ["hugo", "server", "--watch=true", "--bind=0.0.0.0", "--source=\"/src\"", "--destination=\"/output\""], [/* 3 vars */]) = 0
Run Code Online (Sandbox Code Playgroud)
带有 [/* 4 vars */] 的 shell 形式 - 工作正常
ENTRYPOINT strace hugo server --watch=true --bind=0.0.0.0 --source=""/src"" --destination=""/output""
execve("hugo", ["hugo", "server", "--watch=true", "--bind=0.0.0.0", "--source=/src", "--destination=/output"], [/* 4 vars */]) = 0"
Run Code Online (Sandbox Code Playgroud)
Dockerfile:(使用 ubuntu,因为我无法使用 alpine:latest 运行 strace。)
# escape=\
# first …Run Code Online (Sandbox Code Playgroud)