Problems installing / setting up Docker

Hello,

sorry maybe for the crossposting I did in the german section, now I found a hind that much more english support is possible, so I try the same in this section.
If this is not wanted, please feel free to delete my german post: https://discourse.pi-hole.net/t/probleme-beim-installieren-setup-docker/68071/1

Unfortunately I have some problems with the installation / setup.
I have a Volkszähler running from a Raspberry 3, but the computing power is no longer sufficient. That's why I've now upgraded the hardware considerably and want to have a much wider range of software. Everything should run on one system. I'm getting rid of the Raspberry. (Yes, I know, I could also install pihole on the Raspberry alone, I could do that with all the other applications too, but that's not the goal!!!!)
I have jailbroken an ASUS CHROMEBOX 3 Intel i7-8550U 16GB 64GB SSD and installed PROXMOX on it.
It runs an LXC container with Docker.
I want to run some applications in Docker:
Portainer, HomeAssistant, MQTT, CaSSAndRA, Node-RED, Grafana, Octoprint, Volkszähler, AdGuard, Zigbee2MQTT, Watchtower and so on.
None of the applications are running yet, everything is still under construction or in test mode before it goes live.

I now want to put together a docker-compose.yaml so that I can configure and start the pihole container via Docker compose (yes, there are other ways, but that's exactly what I want and nothing else).

Unfortunately, I'm only halfway there, and I don't understand why. Maybe someone can help?

I want to create two volumes:


I think that worked?!

My docker-compose.yaml looks like this so far (I have copied it together, I would be grateful for any hints as to whether it makes sense):

version: "3.7"

services:
  pihole:
    image: pihole/pihole:latest
    container_name: 07_Pihole
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    restart: unless-stopped
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      # DHCP Server Usage
      #- "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    environment:
      TZ: Europe/Berlin
      WEBPASSWORD: raspi
      DNS1: 1.1.1.1
      DNS2: 1.0.0.1
    # Volumes store your data between container upgrades
    volumes:
      - ./data/pihole/conf/:/etc/pihole/
      - ./data/dnsmasq.d/conf/:/etc/dnsmasq.d/
      # run `touch ./var-log/pihole.log` first unless you like errors
      # - './var-log/pihole.log:/var/log/pihole.log'
    dns:
      - 127.0.0.1
      - 1.1.1.1
    labels:
        com.centurylinklabs.watchtower.enable: "true"
    # Recommended but not required (DHCP needs NET_ADMIN)
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    #cap_add:
    #  - NET_ADMIN
    networks:
      - app-nw

networks:
  app-nw:
    internal: false
    driver: bridge
    driver_opts:
      com.docker.network.bridge.name: br-pihole

This error message then appears:

Error response from daemon: driver failed programming external connectivity on endpoint 07_Pihole (31516d70f81d9cc873d484a40ec7a54b421578d52d43f4e9a13068): Error starting userland proxy: listen tcp4 0.0.0.0:53: bind: address already in use

Many thanks and best regards,
Chris

I came a little further:
I edited:

sudo nano /etc/systemd/resolved.conf

and uncommened "DNSStubListener" and changed it to "no", so it looks like this: DNSStubListener=no

Now the container starts without any issues.

BUT:

The volumes did not connect?!


Any idea how to solve that?

Looks like you already created 2 named volumes: pihole-dnsmasq.d and pihole-pihole, but you are not using them in your compose file.

Your current compose file is using different volumes, using paths:

services:
  pihole:
    (...)
    volumes:
      - ./data/pihole/conf/:/etc/pihole/
      - ./data/dnsmasq.d/conf/:/etc/dnsmasq.d/

If you want to use your named volumes, you need to:

  • use their names on the compose file and
  • declare the previously created volumes using external: true, like this:
services:
  pihole:
    (...)
    volumes:
      - pihole-pihole:/etc/pihole/
      - pihole-dnsmasq.d:/etc/dnsmasq.d/
    (...)

networks:
  (...)

volumes:
  pihole-pihole:
    external: true
  pihole-dnsmasq.d:
    external: true

Right now my docker-compose.yaml looks like this:

version: "3.7"

services:
  pihole:
    image: pihole/pihole:latest
    container_name: 07_Pihole
    # For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
    restart: unless-stopped
    environment:
      TZ: Europe/Berlin
      WEBPASSWORD: raspi
      DNS1: 1.1.1.1
      DNS2: 1.0.0.1
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      # DHCP Server Usage
      #- "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    # Volumes store your data between container upgrades
    volumes:
      #- ./data/pihole/conf/:/etc/pihole/
      #- ./data/dnsmasq.d/conf/:/etc/dnsmasq.d/
      - 07_Pihole_pihole:/etc/pihole/
      - 07_Pihole_dsnmasq.d:/etc/dnsmasq.d/
      # run `touch ./var-log/pihole.log` first unless you like errors
      # - './var-log/pihole.log:/var/log/pihole.log'
    dns:
      - 127.0.0.1
      - 1.1.1.1
    labels:
        com.centurylinklabs.watchtower.enable: "true"
    # Recommended but not required (DHCP needs NET_ADMIN)
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    #cap_add:
    #  - NET_ADMIN
    networks:
      - 07_Pihole_net

volumes:
  07_Pihole_pihole:
    name: "07_Pihole_pihole"
  07_Pihole_dsnmasq.d:
    name: "07_Pihole_dsnmasq.d"

networks:
  07_Pihole_net:
    name: "07_Pihole_net"
    internal: false
    driver: bridge
    driver_opts:
      com.docker.network.bridge.name: br-pihole

If I understand you right, I only need to change the volume section to this, right?:

volumes:
  07_Pihole_pihole:
    name: "07_Pihole_pihole"
    external: true
  07_Pihole_dsnmasq.d:
    name: "07_Pihole_dsnmasq.d"
    external: true

I tired this, but the result is the same.
The only difference I noticed is, that with "external: true" docker is not creating a new volume.
If "external: true" is missing, docker is creating a new volume, if this does not exist.

From my understanding "external: true" is not necessary.
In Portainer it looks okay for me:
image


The problem is, that the disk space is too small:
image
But I don't know how to change it?!

image

This (7.8GB) is the size of the root partition on your host machine.

Thank you, now I understand and now I could solve the problem!

Thank you and best regards,
Chris