Ubuntu mate 20.10 Pi 4 Setup problems

The issue I am facing:
I see the following message and due to limited Linux knowledge I'm struggling to resolve this error.

 docker-compose up --detach
ERROR: The Compose file './docker-compose.yaml' is invalid because:
services.Pihole.environment.volumes contains ["./etc-pihole/:/etc/pihole/", "./etc-dnsmasq.d/:/etc/dnsmasq.d/"], which is an invalid type, it should be a string, number, or a null
both netdata and portainer will function without the added Pihole values included.

The current docker-compose.yaml includes this

version: '3.8'
   
services:
   Pihole:
      container_name: pihole
      image: pihole/pihole:latest
      ports:
        - "53:53/tcp"
        - "53:53/udp"
        - "67:67/udp"
        - "80:80/tcp"
         - "443:443/tcp"
      environment:
        TZ: 'Europe/London'
        # WEBPASSWORD: 'set a secure password here or it will be random'
        Webpassword: 'apassword'
        # Volumes store your data between container upgrades
        volumes:
          - './etc-pihole/:/etc/pihole/'
          - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
        # Recommended but not required (DHCP needs NET_ADMIN)
        #  httsp://github.com/pi-hole/pi-hole/docker-pihole#note-on-capabilities
        cap_add:
          - NET_ADMIN
        restart: unless-stopped

Details about my system:
on Pi 4 b with Ubuntu Mate 20.10
attempting to install Pihole into a docker container.

What I have changed since installing Pi-hole:
I noticed on a well known tech site that switching the docker version number may help I have tried 3 & 3.8 with no improvement.

That means

        volumes:
          - './etc-pihole/:/etc/pihole/'
          - './etc-dnsmasq.d/:/etc/dnsmasq.d/'

Is not formatted correctly. See Compose file version 3 reference | Docker Docs for the proper format.

Thank you for the prompt reply. I remain clueless after reading these links.

Your config:

        volumes:
          - './etc-pihole/:/etc/pihole/'
          - './etc-dnsmasq.d/:/etc/dnsmasq.d/'

The accepted (short form):

volumes:
  # Just specify a path and let the Engine create a volume
  - /var/lib/mysql

  # Specify an absolute path mapping
  - /opt/data:/var/lib/mysql

  # Path on the host, relative to the Compose file
  - ./cache:/tmp/cache

  # User-relative path
  - ~/configs:/etc/configs/:ro

  # Named volume
  - datavolume:/var/lib/mysql

Note the differences, primarily with the quote marks.

To be honest, this is a docker configuration issue, you'll need to be knowledgeable with docker to solve the issues that will come up with docker. It may be best to run Pi-hole natively until you are able to run docker and docker-compose and solve the issues that come up. Pi-hole is your network DNS and needs to be running all the time or your network will not operate.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.