Skip to content

ADD/COPY do not strip paths outside of the build context #21827

Open
@cowwoc

Description

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

@dvdksn It looks like the paragraph you changed at https://github.com/moby/buildkit/pull/5664/files#r1916876722 is wrong.

I just tested against Docker version 27.4.0, build bde2b89 and both ADD and COPY commands return this error if you try referencing paths outside of the build context:

ADD failed: forbidden path outside the build context: ../src/main/resources/scripts/helm-install.sh ()

Frankly, I prefer this behavior. It's a lot less error-prone. Can you please update the documentation accordingly?

Location

https://docs.docker.com/reference/dockerfile/#adding-files-from-the-build-context

Suggestion

No response

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions