testcontainers / testcontainers/testcontainers-java

Cannot use against local image Ids

Open
#699 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

resolution/acknowledged type/feature
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

For example, if using the output of --iidfile then the image is attempted to be fetched instead of using the existing local image Id:

Caused by: org.testcontainers.containers.ContainerFetchException: Retry limit reached while trying to pull image: sha256:8cf620617c6203b24af7c5bf15a7212386c27ad008fc4c6ff7e37a1bf0a3cdd2
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:91)
	at org.testcontainers.images.RemoteDockerImage.resolve(RemoteDockerImage.java:25)
	at org.testcontainers.utility.LazyFuture.getResolvedValue(LazyFuture.java:20)
	at org.testcontainers.utility.LazyFuture.get(LazyFuture.java:27)
	at org.testcontainers.containers.GenericContainer.getDockerImageName(GenericContainer.java:839)
	... 55 more
Caused by: com.github.dockerjava.api.exception.NotFoundException: {"message":"pull access denied for sha256, repository does not exist or may require 'docker login'"}

docker run --it --rm sha256:8cf620617c6203b24af7c5bf15a7212386c27ad008fc4c6ff7e37a1bf0a3cdd2 works as expected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with org.testcontainers.images.RemoteDockerImage, especially resolve, and reproduce the reported case using a local image ID from Docker's --iidfile output. Confirm that docker run accepts the sha256 image ID, then verify the completed behavior uses the existing local image instead of attempting a registry pull.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.