Docker CLI will only look for .dockerignore file in the root directory of the context, if you have a monorepo of multiple packages, make sure .Dockerignore file is on the root directory of your context, it will ignore it if it is somewhere in the subfolder.