Skip to content

ADD .. adds the contents of /tmp #1280

Closed

Description

@ndarilek

I'd like to keep my Dockerfile and associated configuration in a subdirectory of a source project, alongside documentation about the configure/build/run process, then ADD .. to include the source of the parent project in the container. Unfortunately .. refers to /tmp, not the directory above that containing Dockerfile. I suppose I could install the SCM in the container and do a full checkout, but that not only bloats the container, but also doesn't let you deploy the currently checked out code. And I could probably include the configuration and README in a subdirectory, but this project already seems to have conventions for keeping non-directly-related code in subdirectories, and it seems like Docker should allow for this convention.

This seems a bit unintuitive. It should either behave correctly or fail meaningfully IMHO.

Thanks.

Activity

  1. vieux commented on Jul 25, 2013

    @vieux
    Contributor

    Hi @ndarilek,

    Seems difficult to do, as the build is made by the server,
    we use context to send the whole context dir as a tarball to the server.

    That's why you can't only ADD from the context dir.

    Maybe you could try to do a link to /tmp inside your directory ?
    And access it via the link.

  2. ndarilek commented on Jul 25, 2013

    @ndarilek
    ContributorAuthor

    Wait, I'm confused, do you mean this is why you can only add, and a
    link from /tmp to my source directory?

    Dunno, if it is difficult then it seems like it should fail
    meaningfully. Maybe if the directory of the ADD is not within the
    originator, the build could fail?

  3. added a commit that references this issue on May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions