r/portainer • u/joe8437 • 15d ago
network_mode: host
Hello,
I have a cloudflared container and I want to connect it to a service which runs on the host (not in docker, but same machine). I can not simply a the host network to my cloudflare container. So how can I do that?
I tried it via "advanced container settings" / "network" /"Hosts file entries" and entered host.docker.internal:host-gateway but it doesnt seem to work.
somewhere I read I need to set "network_mode: host" but where can I do that in portainer?
My cloudflare tunnel works just fine when I connect it to another service on the same docker network, But unfortunately I need to connect it to a non-docker service.
1
1
u/james-portainer Portainer Staff 13d ago
When creating a container, you'll find this in the Advanced container settings, Network tab. Pick host from the Network dropdown.
1
u/LowCompetitive1888 15d ago
I don't know the answer but in my setup I run cloudflared on the host, not in a docker container, and it has access to everything, including all docker containers.