Dupe of #286 by request.
The Docker docs 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/).
To the maintainers of this project:
When #286 was closed, was an intentional choice made to create divergent functionality in docker-java, or was it unclear at the time that a Dockerfile may be validly excluded by a .dockerignore file?
If docker allows, then code could be changed.
This should definitely be changed as the behavior directly contradicts what users will read from the official Docker documentation.
Please fix this. I have to change all of my repos now to workaround this.
Indeed. This is a major issue moving from a shell script using Docker CLI to a Jenkins plugin using the Java API.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It is still a bug.
This still appears to be a bug, ran into it in my workplace's CI/CD:
11:09:15 ERROR: Process finished with exception
11:09:15 java.io.IOException: Dockerfile is excluded by pattern 'Dockerfile' in .dockerignore file
It is still a bug.
Most helpful comment
If docker allows, then code could be changed.