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

Support docker-compose like default network behavior #1088

Merged
merged 2 commits into from
Dec 18, 2024

Conversation

lisongmin
Copy link
Contributor

@lisongmin lisongmin commented Dec 17, 2024

When there is no network defined (neither network-mode nor networks) in service,
The behavior of default network in docker-compose and podman-compose are different.

Top-level networks podman-compose docker-compose
No networks default default
One network named net0 net0 default
Two networks named net0, net1 podman(--network=bridge) default
Contains network named default default default

To enable compatibility between docker-compose and podman-compose, specify
default_net_behavior_compat: true under global x-podman key:

x-podman:
    default_net_behavior_compat: true

@lisongmin lisongmin force-pushed the feat-default-net-behavior-compat branch 2 times, most recently from 6c7a79e to 45ac8c6 Compare December 17, 2024 14:31
@p12tic
Copy link
Collaborator

p12tic commented Dec 17, 2024

Looks good, but please add an integration test. For an example, please see https://github.com/containers/podman-compose/pull/1044/files .

@p12tic
Copy link
Collaborator

p12tic commented Dec 17, 2024

Also, commit message should be 72 characters or less (probably best to remove by default_net_behavior_compat switch).

@lisongmin lisongmin force-pushed the feat-default-net-behavior-compat branch from 45ac8c6 to 420d19d Compare December 18, 2024 05:22
@lisongmin
Copy link
Contributor Author

Done

Copy link
Collaborator

@p12tic p12tic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks great.

@p12tic p12tic merged commit d803c4c into containers:main Dec 18, 2024
7 checks passed
@lisongmin lisongmin deleted the feat-default-net-behavior-compat branch December 19, 2024 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants