Created
December 30, 2018 12:08
-
-
Save vgallet/d1d115804beef106c0e8e99f2d7aa36f 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 -> { | |
.... | |
}) | |
.withExposedPorts(3306) | |
.withCreateContainerCmdModifier( | |
new Consumer<CreateContainerCmd>() { | |
@Override | |
public void accept(CreateContainerCmd createContainerCmd) { | |
createContainerCmd.withPortBindings( | |
new PortBinding(Ports.Binding.bindPort(3306), new ExposedPort(3306)) | |
); | |
} | |
}) | |
.waitingFor(Wait.forListeningPort()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment