testcontainers-go icon indicating copy to clipboard operation
testcontainers-go copied to clipboard

feat: allow explicitly specifying provider type

Open austince opened this issue 1 year ago • 5 comments

What does this PR do?

Allows explicitly setting the provider type via an environment variable or the properties file in addition to the autodetection introduced in https://github.com/testcontainers/testcontainers-go/pull/982

Why is it important?

Autodetection does not work in all scenarios, like when using the Podman Desktop compatibility mode since the docker host still points to the docker unix socket (which has been soft linked).

Related issues

Mentioned in https://github.com/testcontainers/testcontainers-go/issues/604#issuecomment-1843656397

austince avatar Dec 12 '23 00:12 austince

Deploy Preview for testcontainers-go ready!

Name Link
Latest commit 8ac6eb62b186785706524e3689daf9db56669d26
Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/6577abe060790a0008342d35
Deploy Preview https://deploy-preview-1990--testcontainers-go.netlify.app/system_requirements/using_podman
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Dec 12 '23 00:12 netlify[bot]

Hey @austince, as I commented in https://github.com/testcontainers/testcontainers-go/discussions/1991#discussioncomment-7887917, I think we should disregard the manual configuration of the provider but instead make the existing auto-discovery mechanism to detect the provider in a more robust manner.

If you agree, I'd close this PR in favour of another one that makes the mechanism more robust, deprecating the existing non-default providers. Wdyt?

mdelapenya avatar Dec 19 '23 08:12 mdelapenya

If you agree, I'd close this PR in favour of another one that makes the mechanism more robust, deprecating the existing non-default providers. Wdyt?

Would seem to make sense, though a proposal of how to do so would be good to understand what it would take\ -- what are you thinking for this one?

austince avatar Dec 19 '23 15:12 austince

As mentiones in #2264: Maybe using '/info/' '/version' requests to determine if Podman is used.

~> curl  --unix-socket /var/run/docker.sock "http://v1.41/version"  -s | jq '.Components'
[
  {
    "Name": "Podman Engine",
    "Version": "5.0.1",
    "Details": {
         <... snip />
    }
  },
  {
    "Name": "Conmon",
     <... snip />
  },
  {
    "Name": "OCI Runtime (crun)",
     <... snip />
  }
]

godart avatar Apr 18 '24 09:04 godart