is there a way to negate a pattern in .dockerignore?
I am trying to negate a pattern in a .dockerignore. The Globbing is done using Go’s filepath.Match rules. After checking the source, it seems we can negate a pattern by using ^ character.
* ^Dockerfile ^web-app/dist
However, when i docker build, I have the following error:
Dockerfile was excluded by .dockerignore pattern '*'
Do you know if its possible to accomplish what I want ?
One Solution collect form web for “is there a way to negate a pattern in .dockerignore?”
As of version 1.7.0, this is now possible.
! now works as you would expect and is documented in the official Dockerfile reference.
Here’s an example taken from the link above:
*/temp* */*/temp* temp? *.md !LICENSE.md
!LICENSE.md will cause LICENSE.md to be included in the Docker build context despite the