@Test
    public void testThatAuthLocatorIsUsedForContainerCreation() {
        // actually start a container, which will require an authenticated pull
        try (
            final GenericContainer<?> container = new GenericContainer<>(testImageName)
                .withCommand("/bin/sh", "-c", "sleep 10")
        ) {
            container.start();

            assertThat(container.isRunning()).as("container started following an authenticated pull").isTrue();
        }
    }
Containerised docker image registry, with simple hardcoded credentials
core/src/test/java/org/testcontainers/utility/AuthenticatedImagePullTest.java