How to include files outside of Docker's build context?

前端 未结 14 1183
情话喂你
情话喂你 2020-11-22 07:21

How can I include files from outside of Docker\'s build context using the \"ADD\" command in the Docker file?

From the Docker documentation:

T

14条回答
  •  被撕碎了的回忆
    2020-11-22 07:29

    As is described in this GitHub issue the build actually happens in /tmp/docker-12345, so a relative path like ../relative-add/some-file is relative to /tmp/docker-12345. It would thus search for /tmp/relative-add/some-file, which is also shown in the error message.*

    It is not allowed to include files from outside the build directory, so this results in the "Forbidden path" message."

提交回复
热议问题