The Wayback Machine - https://web.archive.org/web/20260115183222/https://github.com/docker/for-linux/issues/44
Skip to content

COPY with a file included in dockerignore issues cannot stat #44

@eelstork

Description

@eelstork

Expected behavior

Using COPY (in a Dockerfile) with a file ignored via .dockerignore the expected behavior is that Docker would return a user friendly message indicating that the file cannot be copied because it matches an entry in .dockerignore.

Actual behavior

Currently docker build will return a cannot stat error instead of providing a user friendly message. This is a problem in a team environment where the dev trying to use the COPY command may not be the same as the dev who created the .dockerignore.

Information

  • Ubuntu Xenial
  • Docker version 17.05.0-ce, build 89658be

There is reaon to believe that same or similar symptoms may be observed on other platforms since this is a design bug.

Steps to reproduce the behavior

  1. cd to a new directory and create foo.txt
  2. Create a .dockerignore file excluding foo.txt
  3. Create a Dockerfile including COPY foot.txt .
  4. Run docker build

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions