{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/15771","labels_url":"https://api.github.com/repos/docker/docker/issues/15771/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/15771/comments","events_url":"https://api.github.com/repos/docker/docker/issues/15771/events","html_url":"https://github.com/docker/docker/issues/15771","id":102523548,"number":15771,"title":"COPY with excluded files is not possible","user":{"login":"bronger","id":2184938,"avatar_url":"https://avatars.githubusercontent.com/u/2184938?v=3","gravatar_id":"","url":"https://api.github.com/users/bronger","html_url":"https://github.com/bronger","followers_url":"https://api.github.com/users/bronger/followers","following_url":"https://api.github.com/users/bronger/following{/other_user}","gists_url":"https://api.github.com/users/bronger/gists{/gist_id}","starred_url":"https://api.github.com/users/bronger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bronger/subscriptions","organizations_url":"https://api.github.com/users/bronger/orgs","repos_url":"https://api.github.com/users/bronger/repos","events_url":"https://api.github.com/users/bronger/events{/privacy}","received_events_url":"https://api.github.com/users/bronger/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-22T10:22:14Z","updated_at":"2015-08-22T13:40:14Z","closed_at":"2015-08-22T13:40:14Z","body":"I need to COPY a *part* of a context directory to the container (the other part is subject to another COPY).  Unfortunately, the current possibilities for this are suboptimal:\r\n\r\n1. COPY and prune.  I could remove the unwanted material after an unlimited COPY.  The problem is that the unwanted material may have changed, so the cache is invalidated.\r\n2. COPY every file in a COPY instruction of it own.  This adds a *lot* of unnecessary layers to the image.\r\n3. Writing a wrapper around the \"docker build\" call that prepares the context in some way so that the Dockerfile can comfortably copy the wanted material.  Cumbersome and difficult to maintain.\r\n"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/133704787","html_url":"https://github.com/docker/docker/issues/15771#issuecomment-133704787","issue_url":"https://api.github.com/repos/docker/docker/issues/15771","id":133704787,"user":{"login":"cpuguy83","id":799078,"avatar_url":"https://avatars.githubusercontent.com/u/799078?v=3","gravatar_id":"","url":"https://api.github.com/users/cpuguy83","html_url":"https://github.com/cpuguy83","followers_url":"https://api.github.com/users/cpuguy83/followers","following_url":"https://api.github.com/users/cpuguy83/following{/other_user}","gists_url":"https://api.github.com/users/cpuguy83/gists{/gist_id}","starred_url":"https://api.github.com/users/cpuguy83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpuguy83/subscriptions","organizations_url":"https://api.github.com/users/cpuguy83/orgs","repos_url":"https://api.github.com/users/cpuguy83/repos","events_url":"https://api.github.com/users/cpuguy83/events{/privacy}","received_events_url":"https://api.github.com/users/cpuguy83/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T13:40:14Z","updated_at":"2015-08-22T13:40:14Z","body":"See https://docs.docker.com/reference/builder/#dockerignore-file\r\nYou can add entries to a .dockerignore file in the root of the project."}}