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

"Host" Network containers #746

Closed
Jedediah04 opened this issue Jan 5, 2021 · 2 comments
Closed

"Host" Network containers #746

Jedediah04 opened this issue Jan 5, 2021 · 2 comments

Comments

@Jedediah04
Copy link

Hello there !

More like a question than an issue.
I just deployed these awesome containers and everything works fine.

I have a question about networking configuration of containers.
Everything works fine for a "bridged" container when exposing his port as specified in the documentation.

My problem is that I have a container (Home Assistant), that needs to be running in "host" network mode to discover devices on the network.
I tried do deploy the container like this :

docker run --detach \ --name home-assistant \ --restart=always \ --expose=8123 \ --volume /var/run/docker.sock:/var/run/docker.sock:ro \ --volume /srv/dev-disk-by-label-data/docker/homeassistant:/config \ --volume /etc/localtime:/etc/localtime:ro \ --env "VIRTUAL_HOST=xxx.mydomain.com" \ --env "VIRTUAL_PORT=8123" \ --env "LETSENCRYPT_HOST=xxx.mydomain.com" \ --env "LETSENCRYPT_EMAIL=noc@mydomain.com" \ --net=host \ homeassistant/home-assistant:stable

As far as I can tell, certificate is okay. I can access the url and the Let's Encrypt Certificate is presented.
The issue is that nginx brings me a 502 bad gateway so I guess something is wrong with my ports or bindings...

Just to let you know, without the "--net=host", everything works fine (but HA can't discover devices).
I know it's more a Docker "question" and I'm sorry about that.

Thanks :)

@buchdag
Copy link
Member

buchdag commented Jan 6, 2021

Hi @Jedediah04

Is your issue similar to #600 ?

@Jedediah04
Copy link
Author

Hello 👍

Thanks for your reply.
Not the same issue, everything works fine but I want to issue a cert for a container which I'm forced to use in host network mode.

Anyway, I closed the issue because I decided to go for a direct nginx installation with acme on the host.

Thanks for your time :)

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