-
Notifications
You must be signed in to change notification settings - Fork 1.1k
"Dockerfile is excluded by pattern" error seems incorrect #286
Description
I have a .dockerignore file that includes the following:
*
!Dockerfile
But I am getting an error message:
Dockerfile is excluded by pattern '*' on line 1 in .dockerignore file
However, my reading of the docker docs (https://docs.docker.com/reference/builder/#dockerignore-file) indicates that this should be ok, in particular:
The placement of ! exception rules influences the matching algorithm; the last line of the .dockerignore that matches a particular file determines whether it is included or excluded.
Additionally, the docs go on to say
You can even use the .dockerignore file to ignore the Dockerfile and .dockerignore files. This is useful if you are copying files from the root of the build context into your new container but do not want to include the Dockerfile or .dockerignore files (e.g. ADD . /someDir/).