Skip to content
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

a command that prints out podman socket address #16725

Closed
davidhsingyuchen opened this issue Dec 4, 2022 · 4 comments
Closed

a command that prints out podman socket address #16725

davidhsingyuchen opened this issue Dec 4, 2022 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@davidhsingyuchen
Copy link

/kind feature

Context: #11397 (comment).

Currently the socket address seems to be only printed in the output of podman machine start:

You can still connect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:

	export DOCKER_HOST='unix:///Users/davidhyc/.local/share/containers/podman/machine/podman-machine-default/podman.sock'

However, it'll be great to be able to get that info anytime when my podman machine is running.

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 4, 2022
@arixmkii
Copy link
Contributor

arixmkii commented Dec 5, 2022

You can extract it from the output of podman machine inspect:

% podman machine inspect | grep .sock
                    "Path": "/Users/redacted/.local/share/containers/podman/machine/podman-machine-default/podman.sock"

@mheon
Copy link
Member

mheon commented Dec 5, 2022

Closing as addressed

@mheon mheon closed this as completed Dec 5, 2022
@davidhsingyuchen
Copy link
Author

Thanks for the response. Command for others to only get the value (e.g., use in a script):

~ podman machine inspect --format '{{ .ConnectionInfo.PodmanSocket.Path }}'
/Users/davidhyc/.local/share/containers/podman/machine/podman-machine-default/podman.sock

@si458
Copy link

si458 commented Jun 24, 2023

@davidhsingyuchen the command doesnt seem to work on windows?

PS C:\Users\sas_2\Documents\Developer\talos> podman machine inspect --format '{{ .ConnectionInfo.PodmanSocket.Path }}'
Error: template: inspect:1:29: executing "inspect" at <.ConnectionInfo.PodmanSocket.Path>: nil pointer evaluating *machine.VMFile.Path

PS C:\Users\sas_2\Documents\Developer\talos> podman machine inspect                                                   
[
     {
          "ConfigPath": {
               "Path": "C:\\Users\\sas_2\\.config\\containers\\podman\\machine\\wsl\\podman-machine-default.json"
          },
          "ConnectionInfo": {
               "PodmanSocket": null,
               "PodmanPipe": {
                    "Path": "\\\\.\\pipe\\podman-machine-default"
               }
          },
          "Created": "2023-06-24T16:55:45.7484971+01:00",
          "Image": {
               "IgnitionFilePath": {
                    "Path": ""
               },
               "ImageStream": "35",
               "ImagePath": {
                    "Path": "C:\\Users\\sas_2\\.local\\share\\containers\\podman\\machine\\wsl\\podman-machine-default_fedora-podman-amd64-v37.0.43.tar"
               }
          },
          "LastUp": "2023-06-24T17:17:44.5220036+01:00",
          "Name": "podman-machine-default",
          "Resources": {
               "CPUs": 16,
               "DiskSize": 750780416,
               "Memory": 667901952
          },
          "SSHConfig": {
               "IdentityPath": "C:\\Users\\sas_2\\.ssh\\podman-machine-default",
               "Port": 57112,
               "RemoteUsername": "user"
          },
          "State": "running"
     }
]

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

4 participants