@Test
    public void simpleDslTest() throws IOException {
        String address = String.format("http://%s:%s", dslContainer.getHost(), dslContainer.getMappedPort(80));

        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        HttpGet get = new HttpGet(address);

        try (CloseableHttpResponse response = httpClient.execute(get)) {
            assertThat(response.getStatusLine().getStatusCode())
                .as("A container built from a dockerfile can run nginx as expected, and returns a good status code")
                .isEqualTo(200);
            assertThat(response.getHeaders("Server")[0].getValue())
                .as(
                    "A container built from a dockerfile can run nginx as expected, and returns an expected Server header"
                )
                .contains("nginx");
        }
    }
Simple test case / demonstration of creating a fresh container image from a Dockerfile DSL
core/src/test/java/org/testcontainers/junit/DockerfileContainerTest.java