Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating FileBuilder without specifying initial command #179

Closed
macsux opened this issue Mar 16, 2021 · 4 comments · Fixed by #180
Closed

Allow creating FileBuilder without specifying initial command #179

macsux opened this issue Mar 16, 2021 · 4 comments · Fixed by #180
Assignees
Labels
enhancement waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further.
Milestone

Comments

@macsux
Copy link

macsux commented Mar 16, 2021

Currently FileBuilder is started from ImageBuilder via From method, but this adds first "command" to the sub-builder. This gets awkward when adding conditional buildup of container image, where first command to be added is not easily identified. This requires tricks like the use of a local function:

FileBuilder From(string image) => fileBuilder == null
            ? builder.From(image)
            : fileBuilder.From(image);

It would be better if FileBuilder can be started without adding the initial command.

@mariotoffia mariotoffia self-assigned this Mar 17, 2021
@mariotoffia mariotoffia added enhancement under-investigation A investigation is made around the issue labels Mar 17, 2021
@mariotoffia mariotoffia added this to the 3.0.0 milestone Mar 17, 2021
@mariotoffia mariotoffia added under-development Denotes that a issue is under development but not yet released. and removed under-investigation A investigation is made around the issue labels Mar 17, 2021
@mariotoffia
Copy link
Owner

I've compiled a pre-release - please have a go https://www.nuget.org/packages/Ductus.FluentDocker/2.8.8-beta.14

@mariotoffia mariotoffia added waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further. and removed under-development Denotes that a issue is under development but not yet released. labels Mar 17, 2021
@mariotoffia
Copy link
Owner

@macsux Please report back if it works or if you have any issues.

@macsux
Copy link
Author

macsux commented Mar 22, 2021

I think relying on From with empty string to implement this is awkward. I suggest adding a new method like DockerfileBuilder to ImageBuilder.

@mariotoffia
Copy link
Owner

I would say the this is consistent how the API do work e.g. public ImageBuilder DefineImage(string image = null). I do not say it is optimal and many things will change when 2.0.0 is released but for now I try to stick to be as consistent as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants