testcontainers / testcontainers/testcontainers-dotnet

[Bug]: Build container failed when Docker is in the Resource Saver Mode

Open
#1,562 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
4.4k
Forks
357
Avg merge
14h 42m
Merged PRs (30d)
16

Description

Testcontainers version

4.8.1

Using the latest Testcontainers version?

Yes

Host OS

Windows

Host arch

x64

.NET version

8.0

Docker version
Client:
 Version:           28.3.2
 API version:       1.51
Server: Docker Desktop 4.44.3 (202357)
 Engine:
  Version:          28.3.2
  API version:      1.51 (minimum version 1.24)
Docker info
Client:
 Version:    28.3.2
What happened?

Build container failed when Docker in the Resource Saver Mode. The call to IsAvailable -> dockerClient.System.PingAsync throws an exception. Need to wrap dockerClient.System.PingAsync with a retry behavior (like 5 x 3 sec ?). The first ping is failed but it wakes up the engine, so the next ping should be OK.
I tried to wrap .Build with a retry behavior, but it doesn't work because DockerEndpointAuthProvider is static and IsAvailable called only once.
Expected result: Can build and run a container when Docker in the Resource Saver Mode.

Relevant log output

Additional information

No response

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 by tracing DockerEndpointAuthProvider and its IsAvailable call to dockerClient.System.PingAsync, then reproduce the failure with Docker Desktop in Resource Saver Mode. Verify that a temporary ping failure wakes the engine and still allows a container to build and run, with regression coverage for the retry behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, docker
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.