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

Is there a way to set several parameters at once? #214

Closed
forfcw opened this issue Sep 22, 2021 · 2 comments
Closed

Is there a way to set several parameters at once? #214

forfcw opened this issue Sep 22, 2021 · 2 comments
Assignees
Labels
answer The question/bug has been answered/workaround recipe
Milestone

Comments

@forfcw
Copy link

forfcw commented Sep 22, 2021

sry, Is there a way to set several parameters at once such as " -t -d --privileged --device /dev/snd --restart=always "and etc, of course I have realized the existing function such as RestartPolicy, but sometimes it make things complicated.
Looking forward to your recovery, tks!

@forfcw forfcw changed the title Is there a way to set several parameters? Is there a way to set several parameters at once? Sep 22, 2021
@mariotoffia
Copy link
Owner

mariotoffia commented Sep 22, 2021

Hi, you may set all those parameters when using layer 1 (commands). Both restart and device is not present on the current FluentAPI (ContainerBuilder).

If you need to use --device and --restart, at the moment, please use the ContainerCreateParams and use that instance on e.g. Create (an extension function that resides in the namespace Ductus.FluentDocker.Commands).

For example:

      using (var container = _host.Create("postgres:9.6-alpine", false,
        new ContainerCreateParams
        {
          Environment = new[] { "POSTGRES_PASSWORD=mysecretpassword" }
        }))
      {
        Assert.AreEqual(ServiceRunningState.Stopped, container.State);
      }

In the ContainerCreateParams you will find all the parameters that you mention such as ContainerCreateParams.RestartPolicy, ContainerCreateParams.Privileged and ContainerCreateParams.Device.

If you really need to have them on the FluentAPI builder (i.e. it is frequently used). Please let me know and I'll add them.

Cheers,
Mario :)

@mariotoffia mariotoffia self-assigned this Sep 22, 2021
@mariotoffia mariotoffia added answer The question/bug has been answered/workaround waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further. recipe labels Sep 22, 2021
@mariotoffia mariotoffia added this to the 3.0.0-RELEASE milestone Sep 22, 2021
@forfcw
Copy link
Author

forfcw commented Sep 23, 2021

Got it, tks !!!

@forfcw forfcw closed this as completed Sep 23, 2021
@mariotoffia mariotoffia removed the waiting-for-feedback Waiting for someone to give feedback until this issue can be brought further. label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answer The question/bug has been answered/workaround recipe
Projects
None yet
Development

No branches or pull requests

2 participants