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

Use docker arguments in FluentAPI or Builder? #88

Closed
stefanjarina opened this issue Jul 17, 2019 · 3 comments
Closed

Use docker arguments in FluentAPI or Builder? #88

stefanjarina opened this issue Jul 17, 2019 · 3 comments
Assignees

Comments

@stefanjarina
Copy link

Hello,

first of all, thank you for this library, it covers almost all my needs.

However, I was wondering if it is possible to somehow specify some docker arguments using Builder or Fluent API?

For example to set a --ulimit argument.

From documentation it is not clear at all, how to add it, if for example I build my container like:

var container = new Builder()
                .UseContainer()
                .WithName($"{_configuration.Prefix}-{service.Name}")
                .UseImage(image)
                .UseNetwork(networkName).Build();

for example, I am trying to replicate this command:

  • When creating Clickhouse --ulimit is advised to use
docker create --net servers -v clickhouse-data:/var/lib/clickhouse --ulimit nofile=262144:262144 --name clickhouse-server -p 8123:8123 -p 9000:9000 yandex/clickhouse-server:$Version

Cheers,
Stefan

@mariotoffia
Copy link
Owner

mariotoffia commented Jul 18, 2019 via email

@mariotoffia mariotoffia self-assigned this Jul 18, 2019
@mariotoffia mariotoffia added this to To do in FluentDocker via automation Jul 18, 2019
mariotoffia pushed a commit that referenced this issue Jul 24, 2019
The bug is when docker-machine was created using --generic-ip-address=docker where it will have docker as the ipaddress.

Now it is possible to set ulimit on ContainerCreateParams and on
the fluent API.
@mariotoffia
Copy link
Owner

@stefanjarina It is in the repo now but I've got a bug that I've fixed that I wanted to be tested before releasing... But now it is possible to write e.g.

        var container =
          Fd.UseContainer()
            .UseImage("postgres:latest", force: true)
            .UseUlimit(Ulimit.NoFile,2048, 2048)
            .WithEnvironment("POSTGRES_PASSWORD=mysecretpassword")
            .Build()
            .Start()

@stefanjarina
Copy link
Author

@mariotoffia Brilliant! This helps a lot, thanks for implementing it so soon.

FluentDocker automation moved this from To do to Done Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
FluentDocker
  
Done
Development

No branches or pull requests

2 participants