HA installation via docker-compose not possible

Hello together,

I am trying to install Home Assistant via docker compose on my RPi 4, but when running the yaml I get this error message:
$ sudo docker-compose up -d
Pulling homeassistant (Package home-assistant · GitHub)…
ERROR: Get “https://ghcr.io/v2/”: dial tcp 140.82.121.34:443: connect: network is unreachable

My yaml looks like this:

What am I doing wrong?

Check your network connection ?

Was Portainer install from ghcr.io as well? Can you open https://ghcr.io from the same network as your RPi4?

Portainer was from docker.
I can open https://ghcr.io from my PC, but when I try to ping ghcr.io from the RPi4 it also states the network is not reachable. Other pages work fine

I think you need to add GitHub as a registry

Sounds like a local issue. Do you use something like PiHole, or do you have a separate IoT VLAN or (WiFi-)network?

Thanks for your all your help.
The problem was inside the raspberry. The default routing was missing (do not know why) and after adding that all worked fine …

“sudo ip route add default via 192.168.0.1 dev eth0” did the trick.