testcontainers/testcontainers-java

Image cache lookup should support SHA256 digests and Image IDs

Open

#1.406 geöffnet am 15. Apr. 2019

Auf GitHub ansehen
 (5 Kommentare) (11 Reaktionen) (0 zugewiesene Personen)Java (1.588 Forks)batch import
good first issuehelp wantedresolution/acknowledgedtype/bug

Repository-Metriken

Stars
 (7.535 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 2T 17h) (2 gemergte PRs in 30 T)

Beschreibung

See #1391 (and this may be related to #699):

Testcontainers' image indexing code can't handle images that have SHA256 digests. We need a way to access the RepoDigests from docker-java's Image class. Unless I'm missing something, at the moment only RepoTags is mapped.

We would then modify RemoteDockerImage:

                List<Image> updatedImages = listImagesCmd.exec();
                updatedImages.stream()
                    .map(Image::getRepoTags)
                    .filter(Objects::nonNull)
                    .flatMap(Stream::of)
                    .map(DockerImageName::new)
                    .collect(Collectors.toCollection(() -> AVAILABLE_IMAGE_NAME_CACHE));

so that both Image::getRepoTags and Image::getRepoDigests are loaded into the cache. There's probably also some work to do around identity/equals/hashcode of DockerImageName objects in the cache.

EDIT 5 June 2020: We should also ensure that Image IDs are loaded into the cache - see #699.

Contributor Guide