Adform Research ▸ ~10 years of JVM programming ▸ ~3 years commercial experience with Scala (+2 as hobby language) @maciejb Speaker Deck: maciejb /maciej
a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in. docker.com
chapter in project’s README ▸ VMs, Vagrant ▸ Running docker outside of the build (+ Docker Compose) ▸ SBT: testOptions in Test += Tests.Setup( () => ??? ) ▸ Testing against an environment ▸ Running Docker from ScalaTest
val DefaultRedisPort = 6379 val redisContainer = DockerContainer("redis:3.0.5") .withPorts(DefaultRedisPort -> None) .withReadyChecker( DockerReadyChecker.LogLineContains("* The server is now ready to accept connections”) ) abstract override def dockerContainers: List[DockerContainer] = redisContainer :: super.dockerContainers }
val clientFut = fakeS3PortFut map { port => val c = new AmazonS3Client(new BasicAWSCredentials("fake", "fake")) c.setEndpoint(s"http://${docker.host}:$port") c.setS3ClientOptions(new S3ClientOptions().withPathStyleAccess(true)) c } Await.result(clientFut, 30.seconds) }