ansred
(Ansred)
April 28, 2021, 2:26am
1
I have the following ingnix stack that is working
web:
image: nginx
container_name: lab-ansred-bootstrap
restart: unless-stopped
volumes:
- /volume1/docker/Bootstrap/AnsRed/config:/usr/share/nginx/html:ro
ports:
- "8003:80"
When I am try to use network mode to use another container as its network.
web:
image: nginx
container_name: lab-ansred-bootstrap
restart: unless-stopped
volumes:
- /volume1/docker/Bootstrap/AnsRed/config:/usr/share/nginx/html:ro
network_mode: "container:gluetun-Mullvad"
I get the following error
The Compose file ‘/data/compose/146/docker-compose.yml’ is invalid because: Unsupported config option for web: ‘network_mode’
I think that has to do with something related to docker compose version, not sure though what to change.
Can someone help on this please.
terpz
(Martin Terp)
May 2, 2021, 6:04pm
4
Hi
This should work, there is no changes in docker-compose v3 regarding this, ever
But i tried to do the same as you, on my own linux pc.
Installed the latest docker-compose via Install Docker Compose | Docker Documentation
used the same docker-compose file as you, and it worked.
even tried with different types of case on the container name.
Are you running this on windows?
ansred
(Ansred)
May 2, 2021, 11:32pm
5
Hey @terpz thanks for testing
Can you share (copy and paste the stack) that worked for you here, to make sure that I don’t miss indentation or spaces or something like that.
My Setup is Synology NAS DSM, Linux
Thanks
terpz
(Martin Terp)
May 3, 2021, 7:31am
6
version: '3.8'
services:
web:
image: nginx
container_name: lab-ansred-bootstrap
restart: unless-stopped
network_mode: "container:TeST-Hest"
1 Like
ansred
(Ansred)
May 3, 2021, 11:06pm
7
@terpz that is actually worked!
There was some bad formatting/spacing in there.
THANKS FOR THE HELP!
1 Like
terpz
(Martin Terp)
May 4, 2021, 7:11am
8
So what changed? because I copy pasted from you
ansred
(Ansred)
May 4, 2021, 9:58am
9
Yeah, these things happens most of the time with docker compose. formatting issues.
Here is the final stack that is working perfectly fine now
version: '3.8'
services:
web:
image: nginx
container_name: lab-ansred-bootstrap
restart: unless-stopped
volumes:
- /volume1/docker/Bootstrap/AnsRed/config:/usr/share/nginx/html:ro
network_mode: "container:gluetun-Mullvad"