Skip to content

Instantly share code, notes, and snippets.

@alirezameskin
Created April 10, 2019 12:17
Show Gist options
  • Save alirezameskin/2c77314cc2c3a1655f114582bd64d3d6 to your computer and use it in GitHub Desktop.
Save alirezameskin/2c77314cc2c3a1655f114582bd64d3d6 to your computer and use it in GitHub Desktop.
val interpreter = spotifyInterpreter(DefaultDockerClient.fromEnv().build())
val program = for {
_ <- pull("busybox:latest")
cntr <- run("busybox", "sh", "-c", "while :; do sleep 1; done")
res <- exec(cntr, "date")
_ <- kill(cntr)
_ <- remove(cntr)
} yield res
val date:Try[String] = program.foldMap(Interpreter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment