You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no container runtime can be reached, the error is one line:
Could not find a working container runtime strategy
getContainerRuntimeClient tries five strategies in turn. The reason each one failed is logged at debug level and then discarded. The person who hits this, usually on first use or in a new CI environment, has to rerun with DEBUG=testcontainers* to learn whether the socket was missing, permission was denied or DOCKER_HOST pointed somewhere unreachable. Seven issues in this repo quote the message.
Expected
The error says what was tried and why each attempt failed, and points to the supported runtimes page:
Could not find a working container runtime. Tried:
- TestcontainersHostStrategy: tc.host is not set
- ConfigurationStrategy: DOCKER_HOST is not set
- UnixSocketStrategy: connect ENOENT /var/run/docker.sock
- RootlessUnixSocketStrategy: no socket at /run/user/1000/docker.sock
- NpipeSocketStrategy: not Windows
See https://node.testcontainers.org/supported-container-runtimes/
Where
getContainerRuntimeClient in packages/testcontainers/src/container-runtime/clients/client.ts, and the strategies in packages/testcontainers/src/container-runtime/strategies/.
Notes
Strategies currently signal "not applicable" by returning nothing, so each needs to return a reason.
Activity