8000 ADD of an absolute path fails with "no such file or directory" instead of "path outside context" · Issue #4592 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
ADD of an absolute path fails with "no such file or directory" instead of "path outside context" #4592
Closed
@ipbabble

Description

@ipbabble

Right now trying to ADD a fully qualified file name (FQFN), e.g. /home/mydir/testfile will fail with the error "no such file or directory".

The failure is on purpose for security reasons. From @tianon: Imagine that I have a Dockerfile that does "ADD /etc/shadow /my/path \n RUN some-command-to-upload-your-etc-shadow-to-my-server".

However at the least the message is wrong and should be something like "forbidden path outside the context". Consider that the client might be remote from the docker daemon.

However if you have common files (tar, configuration, html etc.) that you may wish to include in multiple images, then you need to duplicate these files into each build directory. One could image having a shared file system with lots of common files that are required for different classes of images or for all images (maybe some legal/copywrite document).

How can we maintain the security while at the same time solve the problem of having common files ADDed from one place.

Perhaps we could check to see if the (FQFN) is on a mounted device and allow that? Or some other magic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/builderarea/builder/buildkitIssues affecting buildkitkind/enhancementEnhancements are not bugs or new features but can improve usability or performance.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0