dockerode icon indicating copy to clipboard operation
dockerode copied to clipboard

Cannot locate Dockerfile because of .dockerignore

Open tony-ist opened this issue 2 years ago • 1 comments

Firstly, thanks for the great library.

When building an image from a repository that contains a .dockerignore file there is an issue. If this .dockerignore file contains Dockerfile itself, then we get an error Cannot locate specified Dockerfile: Dockerfile. I suppose it happens because Dockerfile is not sent with the context to the docker daemon.

When you try docker build command through the CLI, such repositories are built without any problems.

Would be great to hear some feedback from you, if it is really a problem and not by design, I can make a PR that fixes it.

tony-ist avatar Feb 20 '23 23:02 tony-ist

Inception :) Yes we don't have any exception for "Dockerfile" in https://github.com/apocas/dockerode/blob/master/lib/util.js#L79 so it ignores itself basically :D

Interesting that CLI manages to build this scenario.

apocas avatar Mar 12 '23 23:03 apocas