testcontainers / testcontainers/testcontainers-java

Socket from DOCKER_HOST not used if default socket exists.

Open
#4,400 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

I am running both docker and podman in parallel. When I try to make testcontainers to use podman by setting the DOCKER_HOST environment variable the test still connected to the default /var/run/docker.sock. I had to stop the docker service and remove the socket by sudo rm -fr /var/run/docker.sock, after that the test connected to the socked specified int the environment variable as expected.

The socket from the environment variable should be used always even if /var/run/docker.sock exists.

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 Testcontainers' Docker client configuration and how DOCKER_HOST is resolved relative to /var/run/docker.sock. Reproduce the issue with both sockets present, then verify that the socket from the environment variable is selected and that the existing default-socket behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.