-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker CLI contexts not used or supported #3146
Comments
Facing the exact issue.
In this scenario I'd expect My awful workaround is echo 'export DOCKER_HOST="unix:///Users/dingobar/.colima/default/docker.sock"' >> ~/.zshrc |
I'm doing this:
|
You might be running into #3190? |
I don't want to write code that selects a specific context, docker-py should know to use the current context. |
Hey, anyone working on this issue? I have some idea for this issue. |
The Docker CLI context not used or supported error message means that the Docker CLI cannot find a context that matches the specified name. This can happen for a few reasons:
To resolve this error, you can try the following: is this correct? guys, I am new to this docker world, so please let me know. everything is AI-generated except me, help me to explore and tackle the open source multiverse |
I stumbled here searching hot to specify context to Workaround I used is to specify context name, if provided, run command and check the endpoint for that context:
sepcify that endpoint:
|
Testing with Docker Desktop on a mac, I have this docker context state:
The
desktop-linux
context is active, and/var/run/docker.sock
does not exist.docker version
correctly uses the active context and returns the server version info. However,docker.from_env()
throws an error:If I set
DOCKER_HOST=unix:///Users/brhiggins/.docker/run/docker.sock
in my shell or in Python before callingdocker.from_env()
, it succeeds.I'll concede that the name
from_env
sort of sounds like it only considers environment variables, but I had read it as creating a client from "the current environment" more broadly, and I had expected it to behave the same as thedocker
CLI.The text was updated successfully, but these errors were encountered: