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
podman.from_env() not working #223
Comments
Same... |
This works. Be sure to activate podman.socket services : podman_client = podman.PodmanClient(base_url="http+unix:///var/run/podman/podman.sock") |
@bdherouville - it really doesn't. I've had better experience connecting to podman using the docker Python library than this one, which is pretty disappointing. |
@josecastillolema From the stack trace line |
@bdherouville I dont think the provided workaround works:
|
Hi @jwhonce ,
Should they be? |
I don't understand, I looked at the python source and the method is : PodmanClient() After enabling podman.socket I was able to access podman from python using : podman.PodmanClient(base_url="http+unix:///var/run/podman/podman.sock") |
|
I just tested on my machine. It is probably an issue with the right on /var/run/podman/podman.sock I need to test to restart the podman.socket service and run it as root:wheel
|
you should NOT be communication with the /var/run/podman/podman.sock from non root users. If you want to run rootless containers then you should start a rootless podman service systemctsl --user start podman.socket |
Those environment variables are interchangeable and one or the other is required when using |
Should podman-py just look for them in the standard location if they are not running? |
@rhatdan the rootless podman service does not work either:
|
@jwhonce so I guess the question is, who is responsible for defining this variables and why are not defined in my environments? |
You should not specify the base_url This is the path for the rootful socket. look at the example below. python-podman does the right thing.
|
@rhatdan :
|
When using from_env() and having not set one of the necessary env var. ```python import sys sys.path.insert(0, './podman') import podman podman.from_env() ``` causes: ```ValueError: CONTAINER_HOST or DOCKER_HOST must be set to URL of podman service.``` fixes containers#223 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Is your podman.service running? And listening on If you do |
Everytime I try podman.from_env() I get this error:
Have tried CentOS 8 stream with a native podman setup and MacOS with podman machine.
Are they any pre-reqs to be able to use podman.from_env() ?
Thanks
CentOS Stream release 8:
MacOS:
The text was updated successfully, but these errors were encountered: