-
Notifications
You must be signed in to change notification settings - Fork 483
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
podman-compose(1) not respecting the "networks:" directive ... #288
Comments
Yes. When podman-compose was created, rootless containers did not have the ability to do inter-container communication. So we did a trick we put all containers in the same network namespace and connect everything using localhost. https://github.com/containers/podman-compose/blob/devel/docs/Mappings.md Now they support rootless networks, but podman compose is not yet using them. |
@muayyad-alsadi Okay. I'll decompose the |
you don't have to. most likely you can go fine by deleting the network section. here is an example which is a django stack having PostgreSQL, RabbitMQ, Memcached ..etc. https://github.com/containers/podman-compose/blob/devel/examples/awx3/docker-compose.yml |
@muayyad-alsadi Ah, yes. That scenario does work. But for my case, I need different So, for example, I need to have one service (container) in But I thought of a quick short-cut that will help me build the manual commands:
Hopefully that makes sense. =:) |
does
|
AFAIK this can be closed, as podman-compose now uses |
The readme states: The main objective of this project is to be able to run docker-compose.yml unmodified and rootless. To achieve that aim, it must support the networks section. Slirp4netns does not help because pods can not communicate using their name, or expose the same port. It probably won't work in rootless mode at all, but in rootfull mode I found this workaround:
|
…n the stack in order to make podman-compose respect the docker-compose network node (see containers/podman-compose#288 (comment)).
+1 for this issue. I am okay with running my containers as root, and I just want to use a Specifically, my issue is with In my setup, this is my docker-compose.yml:
Even though
|
@dblitt you have said what happened but you did not specify what was supposed to happen. would you please specify what podman-compose was supposed to do (what sequence of commands it should have done) https://github.com/compose-spec/compose-spec/blob/master/spec.md#internal NOTE: when you run it rootless (without sudo) it won't be able to do 80:80 port mapping because port 80 would require root. |
Yes, I understand that 80 cannot be bound rootless, that is part of the reason I am running rootful - with the other being using external networks in the first place. When run with docker-compose, the external flagged network is not recreated. Here is a relevant portion of output from
And if the network doesn't exist when
Let me know if I didn't fully answer your question @muayyad-alsadi |
I've just pushed a fix. The given compose will exit
|
Thanks for this fix- it seems to correct the issue as described. I did run into one edge case with redefining the default network though - with a docker-compose.yml as:
podman-compose exits with the following error:
while docker-compose is perfectly happy and outputs the following:
I think this is just an edge case with defining the default network (testing a "defaulttt" network just had docker-compose make its own network). After a quick search through the docker-compose reference I couldn't find anything that talks about this, but I got the idea from this page of nginx-proxy-manager documentation: https://nginxproxymanager.com/advanced-config/#best-practice-use-a-docker-network |
I hate it when they can't make up their mind how to pass things and what is the type of the thing. in this case external is not a boolean, it's might be a dictionary, and sometimes name is read from external and sometimes is read from parent
I've pushed a fix |
Haha I can see why that would be frustrating. Thanks for your work on this! |
Ran into another bug with this: When I have two networks defined, one external and one not, it seems like something got messed up with creating that non-external network. My networks section looks like this:
And the error is:
If the |
I was intending to push it down but I deleted it by mistake - args.append(net_name)
+ if net_desc.get("internal", None):
+ args.append("--internal") fixed now |
Hello Friends:
First, thank you for this project!
=:)
Am I doing something wrong?
podman-compose(1)
(v0.1.7dev
) doesn't seem to respect thenetworks:
directive indocker-compose.yml(5)
. I tried the below a few ways; first creating the networkexternally
(manually) and specifying that to the services stanzas; as well as allowing it to be createddynamically
.But examining the interactive output of
podman-compose -f ./docker-compose.yml up
doesn't show--network mynetwork
in thepodman pod create [ ... ]
command.Am I missing something, or is this not implemented? Not being implemented would be a bummer because I have some several very complex
docker-compose.yml(5)
files that I'd have to convert to manual commands.Alternatively, is it possible to attach a running
pod
tonetworks
(not toports
butnetworks
) after the fact? That would help as a workaround (though I doubt that's possible). It would really be cool ifpodman-compose(1)
natively supported this.See below, and thank you!
The text was updated successfully, but these errors were encountered: