I'm setting up a custom TestContainer by pulling an image from a private registry. At the moment it looks like this (it works):
public static GenericContainer<?> customContainer = new GenericContainer<>(
DockerImageName.parse("private-registry.net:port/path/custom-image"))
.withCreateContainerCmdModifier(cmd -> cmd.withName("Test_Custom").withHostName("custom"))
I'm setting the login information through System.setProperty("registry.username", "username")
(same for password). I don't want my login to be plaintext code. The idea is to login through settings.xml where the private repositories are defined. I'm completely new to this so I don't know if that's even possible? I've tried just adding it into the xml file like so:
<repositories>
<id>custom-image</id>
<url>private-registry.net:port/path/custom-image</url>
......
</repositories>
<servers>
<server>
<id>custom-image</id>
<username>username</username>
<password>password</password>
</server>
</servers>
It doesn't seem to "detect" automatically, how do I get the container to refer to its url and credentials within the xml? Or is this not possible? I only see answers on how you push an image through maven.