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

Error: Conflicting options: port publishing and the container type network mode with IntelliJ #273

Open
dieter-medium opened this issue Aug 1, 2024 · 2 comments

Comments

@dieter-medium
Copy link

I encountered an error with port publishing and the container type network mode while using IntelliJ. It seems to be related to the network mode setting.

Error: conflicting options: port publishing and the container type network mode

The issue seems to occur due to the network mode configuration in the docker-compose.yml. Specifically, in javascript-node-postgres and simalar.

The error is resolved if the network_mode setting is switched between app and db services. For instance, instead of using network_mode: service:db within the app, using network_mode: service:app within db resolves the error.

References:

[YouTrack Issue](https://youtrack.jetbrains.com/issue/IJPL-65932/Devcontainers-Error-response-from-daemon-conflicting-options-port-publishing-and-the-container-type-network-mode)
@chrmarti
Copy link
Contributor

chrmarti commented Sep 3, 2024

Doing it the other way around had the following issue: microsoft/vscode-dev-containers#537.

@dieter-medium
Copy link
Author

This issue might explain why some developers choose to use:

services:
  network_manager:
    image: alpine:latest
    command: ["sleep", "infinity"]  # Keeps the container running

   app:
    ...
    network_mode: service:network_manager

It's an interesting approach to managing shared network environments in Docker Compose. Perhaps IntelliJ will improve its support for this pattern in the future.

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

No branches or pull requests

2 participants