Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.
I apologize for the bad post. When I first posted my email, I did not have the standard buttons and it would not allow me to edit the post afterwards, either. I think it was a temporary glitch, as now it works perfectly.
Your post was marked by the spam filter. I guess that’s why you couldn’t edit until I accepted it (edit: or maybe I remember wrong, as I don’t see any flag on your post). Thank you for editing it now.
So it looks like you want to install dependencies that require special privileges. When you are working with contaiers, you an’t always use the same installer as you would outside containers. Some applications for example depend on Systemd which is also something that Docker images usually don’t have, but there are other ways to install apps usually.
In your case dbus-devel requires communicating with dbus on the host, and it can’t. Are you sure you need that package? What is that you really need to run in the container that required dbus-devel?
It is possible that you need a virtual machine and not a container.
I don’t know if you solved it in the meantime, but I came back though my bookmarks where I saved this topic since I was too tired for thinking about things I don’t normally use
So now I reread the topic title and also read about DBus a little.
So one thing I somehow managed misunderstand last time is that you were talking about native Linux vs WSL2 on Windows and not running something on the host vs in a container.
The other misunderstood part was that the error message is not about not being able to communicate with the dbus daemon, but the dbus-devel package has a dependency which is not available.
So if you use the same Dockerfile on Ubuntu and in WSL2, the package manages should work the same way, but one thing I have notices is that you use the tag rockylinux:8 which could be different versions of Rocky Linux depending on when you pulled the image.
I also found this which is about AlmaLinux, but the reason of the error message could be similar in combination with with a wrong rockylinux version:
If it was indeed similar, you might have solved it by now just by running the build again.
I tried it again and indeed it works now. This is great! I was previously having to dual boot on Windows and Linux to compile my program. You guys rock!
This is my first time with Docker. What should I use to get a consistant version instead of rockylinux:8? I would like to compile with rocky linux 8.1 (latest) or a similar Red Hat (free) derivative. This is to get the most compatibility across Linux versions.