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

docker socket helper should also setup local socket path on macOS #16548

Open
benoitf opened this issue Nov 18, 2022 · 16 comments · May be fixed by #19046
Open

docker socket helper should also setup local socket path on macOS #16548

benoitf opened this issue Nov 18, 2022 · 16 comments · May be fixed by #19046
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. podman-desktop

Comments

@benoitf
Copy link
Contributor

benoitf commented Nov 18, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

Docker Desktop on macOS seems to move to a "local/non root" installation path for the docker.sock file.
https://docs.docker.com/desktop/release-notes/
docker/for-mac#6529

Steps to reproduce the issue:

  1. podman machine start

Describe the results you received:

if podman-mac-helper has been installed, it will install /var/run/docker.sock

Describe the results you expected:

To have socket in /var/run/docker.sock

and to the new local path $HOME/.docker/run/docker.sock (if for some reason the mac helper was not granted root privileges it should add the socket in the home directory)

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

(paste your output here)

Output of podman info:

(paste your output here)

Package info (e.g. output of rpm -q podman or apt list podman or brew info podman):

(paste your output here)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes/No

Additional environment details (AWS, VirtualBox, physical, etc.):

@benoitf benoitf added macos MacOS (OSX) related podman-desktop labels Nov 18, 2022
@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 18, 2022
@github-actions github-actions bot removed the macos MacOS (OSX) related label Nov 18, 2022
@benoitf
Copy link
Contributor Author

benoitf commented Dec 2, 2022

Hello,
In this issue it's to add socket into the HOME folder so there is no need of root permissions. Podman machine can set it up even without an helper

It's to add an extra binding in the home folder. Tooling will probably use this local/per user location as well. ( In addition to the historical /var/run/docker.sock requiring admin privileges on macOS

@n1hility
Copy link
Member

n1hility commented Dec 2, 2022

sorry that was posted to the wrong issue fixing

@n1hility
Copy link
Member

n1hility commented Dec 2, 2022

So I am on the fence on this one, and am wondering if this is the right thing for us to do. The current behavior of Docker Desktop is that all tools use a default context which points to /var/run/docker.sock, which is also where docker client libraries are also hard coded to look. There was a version that switched the active context to a home directory location but it was immediately pulled back. So a user should not normally need this socket to be replaced.

If podman replaces this socket, there is no ability to run docker desktop in parallel with podman, which may not be common but could be useful in cases where you want to move data.

Another approach we could do is add a podman context for users to use via docker context create and switch to it. Although this might introduce issues for users like the ones that lead to them rolling back that default change.

@github-actions
Copy link

github-actions bot commented Jan 3, 2023

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jan 3, 2023

I think podman desktop should tell Podman to listen on this socket by default and then turn it off in the case where users want to install both docker and podman at the same time.

The question is which is going to be more common, users blowing up trying to talk to /var/run/docker.sock or installing docker and podman at the same time on a MAC.

podman desktop could easily figure this out and tell podman to do the right thing. or setup a link to do the right thing.

@benoitf
Copy link
Contributor Author

benoitf commented Jan 3, 2023

IMHO istening to sockets is the job of podman-mac-helper
So of course, from Podman Desktop we can manage the helper but helper should handle the different use-cases. Install globally at /var/run, in home folder or both. (Up to the user to choose how to configure it)

Also people expect to have tooling working even when podman desktop not being launched

@github-actions
Copy link

github-actions bot commented Feb 3, 2023

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

github-actions bot commented Mar 6, 2023

A friendly reminder that this issue had no activity for 30 days.

@ThomasVitale
Copy link

It would be great if Podman could handle the new socket location and get a working setup on macOS without additional manual configuration

@n1hility
Copy link
Member

n1hility commented May 26, 2023

Ok so I see how this is happening. The context configuration is preserved across versions and not changed. So if you started with either 4.13.0, or you started with a config in recent versions with the symlink option deselected (advanced instead of recommended options), then your context config would have been created, preferring the home location. While I don't believe we should modify ~/.docker/run/docker.sock, we could switch the docker default context if the mac helper was installed, implying this was the user's intention. I'll draw up a PR for this soon.

@n1hility
Copy link
Member

/assign

@flouthoc
Copy link
Collaborator

@n1hility A small question, shouldn't podman-mac-helper detect the docker version and work with socket at /Users/<username>/.docker/run/docker.sock instead of silently switching docker's default context ?

@vyasgun
Copy link
Contributor

vyasgun commented Jun 22, 2023

@n1hility can I take up this issue if it hasn't been addressed yet?

vyasgun added a commit to vyasgun/podman that referenced this issue Jun 29, 2023
Fixes: containers#16548

Signed-off-by: vyasgun <vyasgun20@gmail.com>
vyasgun added a commit to vyasgun/podman that referenced this issue Jun 29, 2023
Fixes: containers#16548

Signed-off-by: vyasgun <vyasgun20@gmail.com>
vyasgun added a commit to vyasgun/podman that referenced this issue Jun 29, 2023
Fixes: containers#16548

Signed-off-by: vyasgun <vyasgun20@gmail.com>
@vyasgun vyasgun linked a pull request Jun 29, 2023 that will close this issue
vyasgun added a commit to vyasgun/podman that referenced this issue Jun 29, 2023
Fixes: containers#16548

[NO TESTS NEEDED]

Signed-off-by: vyasgun <vyasgun20@gmail.com>
vyasgun added a commit to vyasgun/podman that referenced this issue Jun 29, 2023
Fixes: containers#16548

[NO NEW TESTS NEEDED]

Signed-off-by: vyasgun <vyasgun20@gmail.com>
@n1hility
Copy link
Member

sorry everyone for the delay was away on vacation recently and missed some github notifications (catching up)

@flouthoc good question, the problem is that nearly everything that speaks Docker (all docker language bindings for python, js, java, etc) expects /var/run/docker.sock (or a named pipe named docker_engine on windows). It's pretty much just the docker CLI that knows how to talk to the recently introduced user dir docker.sock

@benoitf
Copy link
Contributor Author

benoitf commented Sep 27, 2023

I think podman machine, should register a docker context 'podman' and switch to this context if the current context is not reachable

It's how Docker Desktop does (and others)

@n1hility
Copy link
Member

n1hility commented Oct 3, 2023

IMO listening on an address that isn't in use is one thing, but reconfiguring another programs client when the user hasn't requested it and without prompting them to is a bit aggressive. Today we are cautious with Podman Desktop and we prompt the user if they would like compatibility mode. Shouldn't we be consistent and only reconfigure clients when they ask?

It's how Docker Desktop does (and others)

The only way I am aware of that docker changes this (aside from the past broken version) is if they explicitly disable /var/run/docker.sock support as part of install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. podman-desktop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants