No internet access from HA Docker container

Dear all,

I run Home Assistant with Docker and I have run into an issue that I don’t know how to resolve.

The problem is that the container cannot access the internet. I confirmed this my getting into the container and pining google.com. Therefore, no cloud-based integration works.

Everything worked fine until a couple of weeks ago. I restarted my server and then this problem started. Sometimes after a couple of days, for no apparent reason, the container re-gains access to the internet.

Any ideas?

Thank you very much.

It would help if you showed your docker compose file, or your docker run command. Without that, it is just guessing

Sure, the config is below, but I haven’t changed it since ever, including when the container did work. I think the issue lies somewhere else.

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /home/homeassistant/.homeassistant:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host