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

Support for tmpfs #83

Closed
alienscience opened this issue Jul 5, 2017 · 2 comments
Closed

Support for tmpfs #83

alienscience opened this issue Jul 5, 2017 · 2 comments

Comments

@alienscience
Copy link

This library is awesome for integration testing -- many thanks.

One thing that I have noticed is that most tests can run much faster if the docker tmpfs feature is used when running a container. For instance, on OSX one test went down from 40 seconds to 10 seconds when the database was run in tmpfs.

Using tmpfs is done through the HostConfig part of the docker API.

Would it be possible to support the tmpfs option in docker-it-scala?

@viktortnk
Copy link
Contributor

@alienscience Thanks for suggesting this option. I've added support for it, but it looks like this option is only available in Spotify's executor.

Released under v0.9.4

@alienscience
Copy link
Author

Many thanks, this works great and gave the performance increase we were expecting.

In case anybody is reading this in the future, this is how to use tmpfs:

  // Run the app on tmpfs -- this improves peformance especially on OSX
  val hostConfig = HostConfig(tmpfs = Some(Map("/YOUR/mountpoint/here" -> "rw,size=250M")))

  // Then add hostConfig when creating the docker container
  val myContainer = DockerContainer(containerName)
    .withPorts(MyPort -> None)
    .withReadyChecker(
      DockerReadyChecker.LogLineContains(
        "Your ready checker here"
      )
    )
    .withHostConfig(hostConfig)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants