mariotoffia / FluentDocker

Use docker, docker-compose local and remote in tests and your .NET core/full framework apps via a FluentAPI
Apache License 2.0
1.31k stars 97 forks source link

The generated Dockerfile is left in working directory when using FromFile #280

Open rjnilsson opened 1 year ago

rjnilsson commented 1 year ago

When using the FileBuilder/FromFile in combination with WorkingDirectory the copied Dockerfile seems to always get left in the working directory.

As I need to set the working directory to get the proper build context, this means that I now have an extra Dockerfile in my filesystem (as the build context is a step above the location of the Dockerfile in my case). This in turn means that I'm likely to commit that extra Dockerfile at some point.

Would it be possible to discard that generated Dockerfile during Dispose of the image? At least be able to do it by passing an extra argument to the FromFile method, or, maybe even better, add an explicit "WithBuildContext" method?

All this unless I've missed out on the option of just setting the build context? I really don't have a need for copying or modifying the Dockerfile; I only want to use an existing file and be able to pass build arguments.