faradayio / cage

Develop and deploy complex Docker applications
http://cage.faraday.io
Apache License 2.0
307 stars 26 forks source link

chore: add pod name to dc project label #110

Closed neezer closed 3 years ago

neezer commented 3 years ago

Adds the pod name to the Docker Compose project name. This completely eliminates the orphaned container warning messages for me, though I don't know all the ramifications of this change. Basic commands like up, status, stop, & rm all seem to work.

One effect (drawback?) is that by default a new network will be created for each pod, unless one changes the pod definitions to use a manually-created external network—which is what I did. IMO this is something that should be Cage's responsibility, but I didn't see any code path specific to network creation, so I guess that would be a new feature.

Apologies for any newbie mistakes: my only experience with Rust has been reading the Rust book yesterday.

closes #108


I'm seeing lots of cargo clippy errors about imports that shouldn't have been affected by my changes, and I don't see any such errors in master. What's up with that?

emk commented 3 years ago

Thank you for the suggestion!

Unfortunately, I believe that this change would break the ability of services in different pods to access each other over the network, which is a very important cage feature that Faraday uses heavily to communicate between front-end services and internal services.

neezer commented 3 years ago

Unfortunately, I believe that this change would break the ability of services in different pods to access each other over the network, which is a very important cage feature that Faraday uses heavily to communicate between front-end services and internal services.

That’s what I mentioned in my PR description, when I said

One effect (drawback?) is that by default a new network will be created for each pod, unless one changes the pod definitions to use a manually-created external network—which is what I did. IMO this is something that should be Cage's responsibility, but I didn't see any code path specific to network creation, so I guess that would be a new feature.

If cage took responsibility for network creation instead of relying on the Docker Compose default behavior, then we could preserve the original behavior that cage provides now without any additional effort on behalf of the user, while still making projects pod-specific.