The problem can be debugged in RemoteDockerImage#resolve.
The call to List<Image> updatedImages = (List)listImagesCmd.exec() returns the sshd image but it has a null repoTags. Thus AVAILABLE_IMAGE_NAME_CACHE is not updated with it and it's pulled.
$ docker inspect e716acb1cdb2
[
{
"Id": "sha256:e716acb1cdb228671503beae1f4048b711f7edcab5f1b0decaf7e380ce14e312",
"RepoTags": [],
"RepoDigests": [
"quay.io/testcontainers/sshd@sha256:18aa929c653284189fc9cefa45b731021857b6047a0a1757e909f958f258f088"
],
..
@rnorth said:
Hmm, this could be a bug introduced during the refactoring of image identity handling (related to registry auth)
I'm on TC 1.11.1.
I've done some digging and put together a test that confirms this.
There are two problems:
TestcontainersConfiguration for the sshd image uses a SHA256-versioned image rather than an image tag. This can be worked around via a properties file to override the default sshd image (see docs, although this option is not explicitly documented)RepoDigests from docker-java's Image class. Unless I'm missing something, at the moment only RepoTags is mapped.I'll raise a PR to fix issue (1), and a separate issue to track (2).
Released in 1.11.2!
Thanks @rnorth , will try it later today :)
Confirmed that it works! Thanks again
Most helpful comment
Confirmed that it works! Thanks again