How to execute the equivalent cmd with GenericContainer from test containers lib

Viewed 267

What is the right way of executing the following docker command in GenericContainer

docker container run \
   --publish 9092:9082 \
   --detach \
   --name h2 \
   nemerosa/h2

@ClassRule
public static GenericContainer h2db =
            new GenericContainer("nemerosa/h2")
                    .withCommand("--publish 9092:9082", "--detach", "--name lm", "nemerosa/h2")
                    .withStartupTimeout(Duration.ofSeconds(Constants.TIMEOUT_DURATION));

I cannot assert if the following commands are equivalent ?

0 Answers
Related