I am building maven project using maven docker image. Maven project is very big like more than 300mb source code. So when I run docker build it needs to send all build context[source code] to Docker daemon. The issue is suppose if I have already build my maven project then source code size becomes more than 5gb including all the target directories.
So in .dockerignore I need to ignore all the /target/ directories.
I tried this but its not working
.git
**/target/*.*
It should be same as we do it in
.gitignore
, so to ignore target folder just usetarget/
.