https://github.com/moby/buildkit/issues/4964苹果测试工程师的日常这个问题其实挺有意思的,遇到一个没有想到的问题 COPY --from=A /home/b/ /home/b/ 加上 --link --chown=b:b 以后遇到了上面的问题。解决方法是在一个单独的 stage 里 chown 修完以后发现虽然能运行但会因为没有权限在 /home/b/ 下写文件导致退出 一查 /home/b/ 的 owner 居然变成了 root:root … 一开始还以为是我 chown 的姿势不对,换了好几种姿势,又不断在中途 debug,终于确定这个问题是 COPY --link…
给上游提了个完善文档的建议
GitHub
docs: proposal to raise awareness about an unexpected behavior of COPY --link · Issue #4964 · moby/buildkit
Situation: Amended the COPY instruction with --link to make better usage of the build cache, and unexpectedly introduced a file permission problem. I copied the directory /home/nonroot/ of a builde...