testcontainers / testcontainers/testcontainers-java
[Enhancement]: Support different docker context
Open
Nobody has claimed this yet.
type/enhancement
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
Module
Core
Proposal
% docker context ls
NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR
default Current DOCKER_HOST based configuration unix:///var/run/docker.sock https://api.xpto.net:6443 (dlovison) swarm
desktop-linux unix:///Users/dlovison/.docker/run/docker.sock
my-remote-engine2 * ssh://vagrant@192.168.56.6
When I execute my test
16:25:20,932 ERROR (testng-ExampleJdg4931) [org.testcontainers.dockerclient.DockerClientProviderStrategy] Could not find a valid Docker environment. Please check configuration. Attempted configurations were:
16:25:20,932 ERROR (testng-ExampleJdg4931) [org.testcontainers.dockerclient.DockerClientProviderStrategy] UnixSocketClientProviderStrategy: failed with exception InvalidConfigurationException (Could not find unix domain socket). Root cause NoSuchFileException (/var/run/docker.sock)
16:25:20,933 ERROR (testng-ExampleJdg4931) [org.testcontainers.dockerclient.DockerClientProviderStrategy] As no valid configuration was found, execution cannot continue
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Core module and the DockerClientProviderStrategy errors shown in the issue, especially UnixSocketClientProviderStrategy. Compare the current Docker environment detection with the configurations listed by docker context ls. Done means a selected non-default Docker context can be used instead of requiring /var/run/docker.sock, with the relevant Testcontainers checks passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100