Help with Docker Compose Error: Conflicting Network Options

0
3
Asked By CuriousCactus42 On

I'm having trouble deploying my Docker stack and keep running into the following error: 'Failed to deploy a stack: compose up operation failed: Error response from daemon: conflicting options: port publishing and the container type network mode.' I'm still learning about YAML and Docker Compose, so I'm not entirely sure what's going wrong. Below is the configuration I'm working with. Could someone shed some light on this for me?

2 Answers

Answered By HelpfulHedgehog87 On

To add to that, OP, there are some flags you can't use if your container's network mode is set to another service, like your Nginx container. Specifically, options related to networking (like `--publish` and `--expose`) won't be supported. Take a look at the official Docker documentation for more details on this!

CuriousCactus42 -

Thanks for the pointers! I'll definitely check the documentation.

Answered By TechyTurtle99 On

Looks like you’re hitting a classic issue with Docker. The error means you’re trying to use conflicting options. Specifically, your Nginx container is set to use the 'network_mode: service:vpn', but you're also trying to publish ports for it. This won't work because you can’t mix port publishing with certain network modes. You need to decide how you want to expose your service without causing these conflicts.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.