I want to exclude a sub-directory using a .dockerignore file, but I don't know what the syntax should be, and there are no examples anywhere.
I have a sub-directory vendor/bundle.
I've put
vendor/bundle in the .dockerignore file. Also vendor/bundle/ and /vendor/bundle but none of them seem to work.
(Also, the .dockerignore file is being found, but just not working.)
The . dockerignore file is a special file that can be placed within the build context directory. The build context directory is the directory that we specify at the end of a docker build command.
There is a shorter and easier method to write your .dockerignore :
vendor/bundle/**/* vendor/bundle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With