Official nextcloud docker image does not work

Hallo guys,

If i try to set up an nextcloud container with

sudo docker compose up -d

i get the following error message:

[+] Running 0/2
 ⠿ db Error                                                                                                                                                                                                    12.3s
 ⠿ app Error                                                                                                                                                                                                   12.3s
Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io: no such host

It dosent matter if image version is nextcloud:v24.

here is my “docker-compose.yaml”

version: '2'

volumes:
  nextcloud:
  db:

services:
  db:
    image: mariadb:10.5
    restart: always
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=%mypass%%
      - MYSQL_PASSWORD=%mypass2%%
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud

  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    links:
      - db
    volumes:
      - nextcloud:/var/www/html
    environment:
      - MYSQL_PASSWORD=%mypass2%%
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - MYSQL_HOST=db
#    networks:
#     macvlan0:

#networks:
#  macvlan0:
#    name: macvlan0
#    external: true

Do you have any advice?

Greetings

I guess you accidentally created an other topic later

Since you got an answer from @meyay in the other one I close this one.