Created
December 29, 2018 18:59
-
-
Save vgallet/98292e5c40aa4ee4d174a43ce3c3d6f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ClassRule | |
public static GenericContainer mysql = new GenericContainer( | |
new ImageFromDockerfile("mysql-petclinic") | |
.withDockerfileFromBuilder(dockerfileBuilder -> { | |
dockerfileBuilder.from("mysql:5.7.8") | |
.env("MYSQL_ROOT_PASSWORD", "root_password") | |
.env("MYSQL_DATABASE", "petclinic") | |
.env("MYSQL_USER", "petclinic") | |
.env("MYSQL_PASSWORD", "petclinic") | |
.add("a_schema.sql", "/docker-entrypoint-initdb.d") | |
.add("b_data.sql", "/docker-entrypoint-initdb.d"); | |
}) | |
.withFileFromClasspath("a_schema.sql", "db/mysql/schema.sql") | |
.withFileFromClasspath("b_data.sql", "db/mysql/data.sql")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment