-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add support for ENV in FileBuilder #177
Comments
ENV, ARG, ENTRYPOINT, LABEL, USER, VOLUME
ENV, ARG, ENTRYPOINT, LABEL, USER, VOLUME. Also support for the new parameters on FROM, COPY.
I've compiled a pre-release - please have a go https://www.nuget.org/packages/Ductus.FluentDocker/2.8.8-beta.14 |
@macsux Please report back if it works or if you have any issues. |
ENV is awkward to work with, and can't chain multiple values into one command easily. I propose something like this: class EnvCommand : ICommand
{
public Dictionary<string, string> Values { get; }
public EnvCommand(Dictionary<string, string> values)
{
Values = values ?? new();
}
public override string ToString()
{
return $"ENV {string.Join(" \\\n ", Values.Select(x => $"{x.Key}={x.Value}"))}";
}
} public FileBuilder Environment(this FileBuilder builder, Dictionary<string, string> values)
{
_config.Commands.Add(new EnvCommand(values));
return builder;
} |
I don't quite follow you - what is the problem with this? new EnvCommand(
"MY_ENV=a env",
"NEXT_ENV=next var",
"PASSWORD=DbPass-for-admin"
); |
Template string doesn't really tell me the correct syntax I need to
provide. I'm mainly guessing at that point. Are the values separated by =,
is it an alternating array of key/value pairs? Dictionary makes this very
intuitive.
…On Mon, Mar 22, 2021 at 2:28 PM Mario Toffia ***@***.***> wrote:
I don't quite follow you - what is the problem with this?
new EnvCommand(
"MY_ENV=a env",
"NEXT_ENV=next var",
"PASSWORD=DbPass-for-admin"
);
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#177 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAINFWHD4FNPJI226RYKHKLTE6D37ANCNFSM4ZJB7UMQ>
.
|
Yes, but it is how the other env API already work e.g.
|
When building up image definition via
FileBuilder
, should allow defining DockerfileENV
directiveThe text was updated successfully, but these errors were encountered: