Skip to content

Instantly share code, notes, and snippets.

@vgallet
Created December 29, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgallet/9a052003114ce49ff71d2eb8c18450b1 to your computer and use it in GitHub Desktop.
Save vgallet/9a052003114ce49ff71d2eb8c18450b1 to your computer and use it in GitHub Desktop.
@ClassRule
public static GenericContainer mysql = new GenericContainer(
new ImageFromDockerfile("mysql-petclinic")
.withDockerfileFromBuilder(dockerfileBuilder -> {
dockerfileBuilder.from("mysql:5.7.8")
// root password is mandatory
.env("MYSQL_ROOT_PASSWORD", "root_password")
.env("MYSQL_DATABASE", "petclinic")
.env("MYSQL_USER", "petclinic")
.env("MYSQL_PASSWORD", "petclinic")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment