docker-api-rs icon indicating copy to clipboard operation
docker-api-rs copied to clipboard

is there an equivalent of `--file` as used through the Docker cli?

Open gregcusack opened this issue 1 year ago • 0 comments

In the docker reference page they outline the ability to pass in a path to a dockerfile using --file. So from the command line we can run something like:

docker build -t <tag-name> -f <path-to-docker-file> <path-to-context>

I can't seem to find this functionality or the equivalent implementation. Also could have totally just missed it.

I would love to utilize this functionality since I have a Dockerfile in a large repository and Images::build() and Images::build_par() are too slow. So would love to have a Dockerfile in its own directory within the large repo and build an image as I can through the command line like:

docker build -t <tag-name> -f <large-repo/dockerfile-repo/Dockerfile> <large-repo>

Does this functionality exist? Or is there an equivalent way of doing this? Once again, I may have missed it in the docs/code, so my apologies if that is the case! Thank you!

  • Greg

gregcusack avatar Aug 28 '23 17:08 gregcusack