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

Rootless containers running through podman-compose cannot access host services #1036

Open
petasis opened this issue Sep 11, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@petasis
Copy link

petasis commented Sep 11, 2024

Describe the bug
I have just upgraded to Fedora 40, and this has caused a havoc in my rootless podman-compose containers, that were working under Fedora 39. The root of the problem is that host services (e.g. the HTTPS web server running on host) are no longer accessible.

$ podman-compose version
podman-compose version 1.2.0
podman version 5.2.2

Environment:

  • OS: Linux / Fedora 40
  • podman version: 5.2.2
  • podman compose version: 1.2.0

Additional context

I have read several bugs reports about podman switching to pasta, and I have tried several approaches proposed (switching to slirp4netns in containers.conf, using pasta with options --map-guest-addr, etc.)

However, these seem to work when I manually run a container with podman run, but not when I run the containers through podman-compose.

Is there a solution to make my containers work again and access host services from them, as before the upgrade to Fedora 40?

I have been looking for more than 3 days for a solution, without success. Under Fedora 39, it worked out of the box, I haven't done anything special. I was accessing the host through its DNS hostname entry.

@petasis petasis added the bug Something isn't working label Sep 11, 2024
@juhojama
Copy link

juhojama commented Oct 7, 2024

Confirmed. While using Podman Compose to run the Podman containers, networking between containers and from container to host worked just fine.

@petasis
Copy link
Author

petasis commented Oct 13, 2024

I am confused. What worked under podman-compose? It does not work for me, containers cannot communicate with any service running on the host.

@BobbyWibowo
Copy link

Did you ever manage to get this working?

@petasis
Copy link
Author

petasis commented Oct 20, 2024

Yes, but throwing away this pasta thing, and restoring the previous approach.

I created a file named ~/.config/containers/containers.conf and put inside:

[network]
default_rootless_network_cmd = "slirp4netns"

Don't forget to reboot the machine (or at least the podman services).

My personal opinion is that developers have done a huge mistake by adopting pasta and inserting such an incompatible change.

Running rootless containers is the main feature to choose podman, and loosing access to the host is a very bad decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants