1

Can docker containers share a unix abstract socket like the ones for DBUS?

If it can be done, how do you do it?

If it cannot or cannot yet, is there a way to share a dbus connection among the host and containers, or between containers?

1 Answer 1

4

Here is the answer from another site :

DBus uses abstract sockets , which are network-namespace specific.

So the only real way to fix this is to not use a network namespace (i.e. docker run --net=host). Alternatively, you can run a process on the host which proxies access to the socket. I think that's what xdg-app does basically (also for security reasons to act as a filter).

There might be some other way, but that's all I can think of offhand.

http://ask.projectatomic.io/en/question/3647/how-to-connect-to-session-dbus-from-a-docker-container/

Sign up to request clarification or add additional context in comments.

3 Comments

the original answer also mentioned a linked page about abstract socket here. thank you for the solution.
@minghua can you accept the answer if it worked for you ?
thanks for finding this answer from the atomic project site. but it's missing a key link as to how the --net=host setup would work. by default dbus daemon is launched through abstract socket on linux. how exactly can you change the default to make it go through something relating to the docker host net? I have not got time to figure out that part and be sure this works for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.