testcontainers / testcontainers/testcontainers-java

[Enhancement]: Support different docker context

Open
#5,837 25 comments 20 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.