Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.testcontainers.utility.DockerLoggerFactory;
import org.testcontainers.utility.ImageNameSubstitutor;
import org.testcontainers.utility.LazyFuture;
import org.testcontainers.utility.TestcontainersConfiguration;

import java.time.Duration;
import java.time.Instant;
Expand All @@ -35,7 +36,9 @@
@AllArgsConstructor(access = AccessLevel.PACKAGE)
public class RemoteDockerImage extends LazyFuture<String> {

private static final Duration PULL_RETRY_TIME_LIMIT = Duration.ofMinutes(2);
private static final Duration PULL_RETRY_TIME_LIMIT = Duration.ofSeconds(
TestcontainersConfiguration.getInstance().getImagePullTimeout()
);

@ToString.Exclude
private Future<DockerImageName> imageNameFuture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ public Integer getImagePullPauseTimeout() {
return Integer.parseInt(getEnvVarOrProperty("pull.pause.timeout", "30"));
}

public Integer getImagePullTimeout() {
return Integer.parseInt(getEnvVarOrProperty("pull.timeout", "120"));
}

public String getImageSubstitutorClassName() {
return getEnvVarOrProperty("image.substitutor", null);
}
Expand Down
3 changes: 3 additions & 0 deletions docs/features/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ but does not allow starting privileged containers, you can turn off the Ryuk con

## Customizing image pull behaviour

> **pull.timeout = 120**
> By default Testcontainers will timeout if pull takes more than this duration (in seconds)

> **pull.pause.timeout = 30**
> By default Testcontainers will abort the pull of an image if the pull appears stalled (no data transferred) for longer than this duration (in seconds).

Expand Down