Hey All. I'm sure there is a simple answer to this...
# general
r
Hey All. I'm sure there is a simple answer to this one... We're looking at options for a new test harness using testcontainers to integrate into our CI pipeline. All is working well if I execute the tests using pytest, however I'm receiving the below error when running the same test in pants:
Copy code
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Any tips?
1
e
Do you have that file present on your machine or is Docker configured to use an alternate communication channel?
r
Just to add that a
pants publish
works as intended.
e
If you don't have the file presumably there is a docker env var of some sort and Pants blocks most env vars by default; so you'd let the appropriate ones leak with: https://www.pantsbuild.org/docs/reference-test#extra_env_vars
r
Ah yeah good point, I do use Colima on my local
Yep, that must be it. Thanks John, will take a look!
This works...
Copy code
./pants test --test-extra-env-vars="['DOCKER_HOST="unix://$HOME/.colima/docker.sock"']"
Thanks for answering my silly question 🙂
👍 1