Skip to content

Commit

Permalink
Merge pull request #246 from grouzen/improve-localstack-v1
Browse files Browse the repository at this point in the history
Align localstack v1 with other containers allowing to override docker image entirely
  • Loading branch information
dimafeng authored Apr 13, 2023
2 parents 5e240f4 + 5a98528 commit 2bdd7d1
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package com.dimafeng.testcontainers
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.client.builder.AwsClientBuilder
import org.testcontainers.containers.localstack.{LocalStackContainer => JavaLocalStackContainer}
import org.testcontainers.utility.DockerImageName

case class LocalStackContainer(
tag: String = LocalStackContainer.defaultTag,
dockerImageName: DockerImageName = DockerImageName.parse(LocalStackContainer.defaultDockerImageName),
services: Seq[LocalStackContainer.Service] = Seq.empty
) extends SingleContainer[JavaLocalStackContainer] {

override val container: JavaLocalStackContainer = {
val c = new JavaLocalStackContainer(tag)
val c = new JavaLocalStackContainer(dockerImageName)
c.withServices(services: _*)
c
}
Expand All @@ -23,20 +24,22 @@ case class LocalStackContainer(

object LocalStackContainer {

val defaultImage = "localstack/localstack"
val defaultTag = "0.12.12"
val defaultDockerImageName = s"$defaultImage:$defaultTag"

type Service = JavaLocalStackContainer.Service

case class Def(
tag: String = LocalStackContainer.defaultTag,
dockerImageName: DockerImageName = DockerImageName.parse(LocalStackContainer.defaultDockerImageName),
services: Seq[LocalStackContainer.Service] = Seq.empty
) extends ContainerDef {

override type Container = LocalStackContainer

override def createContainer(): LocalStackContainer = {
new LocalStackContainer(
tag,
dockerImageName,
services
)
}
Expand Down

0 comments on commit 2bdd7d1

Please sign in to comment.