{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/compose/issues/2443","labels_url":"https://api.github.com/repos/docker/compose/issues/2443/labels{/name}","comments_url":"https://api.github.com/repos/docker/compose/issues/2443/comments","events_url":"https://api.github.com/repos/docker/compose/issues/2443/events","html_url":"https://github.com/docker/compose/issues/2443","id":118276724,"number":2443,"title":"Build cache issue when Dockerfile is listed in .dockerignore.","user":{"login":"0x4d4c","id":7069914,"avatar_url":"https://avatars.githubusercontent.com/u/7069914?v=3","gravatar_id":"","url":"https://api.github.com/users/0x4d4c","html_url":"https://github.com/0x4d4c","followers_url":"https://api.github.com/users/0x4d4c/followers","following_url":"https://api.github.com/users/0x4d4c/following{/other_user}","gists_url":"https://api.github.com/users/0x4d4c/gists{/gist_id}","starred_url":"https://api.github.com/users/0x4d4c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0x4d4c/subscriptions","organizations_url":"https://api.github.com/users/0x4d4c/orgs","repos_url":"https://api.github.com/users/0x4d4c/repos","events_url":"https://api.github.com/users/0x4d4c/events{/privacy}","received_events_url":"https://api.github.com/users/0x4d4c/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-22T17:38:39Z","updated_at":"2015-11-22T17:38:39Z","closed_at":null,"body":"When the Dockerfile contains a `COPY` of a directory and the Dockerfile is listed in the .dockerignore then `docker-compose build` doesn't pick up on changes of files in this directory and uses the build cache instead. Building the same image with `docker build` works as expected. Removing the Dockerfile from the .dockerignore also leads to the expected behaviour.\r\nI created some [example files](https://github.com/0x4d4c/docker-compose-dockerignore-issue.git) to illustrate and reproduce the issue.\r\n\r\nTested with:\r\n```\r\ndocker-compose version: 1.4.0\r\n```\r\n```\r\ndocker-compose version: 1.5.1\r\n```\r\n```\r\ndocker-compose version 1.6.0dev, build unknown\r\n```\r\nand\r\n```\r\nDocker version 1.9.0, build 76d6bc9\r\n```"}}