Home > Back-end >  i keep getting "services.pihole.environment must be a mapping" while trying to run a docke
i keep getting "services.pihole.environment must be a mapping" while trying to run a docke

Time:11-21

Trying to paste the following code into a .yml file using ssh to access the host computer thats running openWRT. i copied it in via vim, is there a chance i get weird indent erros from copying?

when i try to run the container i get the "must be mapping" error message, after googling most people seem to say this is due to indent errors in the yml file. if the following code looks correct then i can send the rest of commands i performed.

can someone please help me troubleshoot this error.

update: uncommenting timezone fixed it, instead i get the error message "no matching manifest for linux/mipsle in the manifest list entries" now, what does this mean?

version: "3.3"

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:2021.09
    hostname: pihole
    environment:
      # TZ: 'set timezone'
      # WEBPASSWORD: 'set a secure password here or it will be random'
    # Volumes store your data between container upgrades
    volumes:
      - './pihole/etc-pihole/:/etc/pihole/'
      - './pihole/etc-dnsmasq.d/:/etc/dnsmasq.d/'
      - './pihole/var-log/:/var/log'
      - './pihole/etc-cont-init.d/10-fixroutes.sh:/etc/cont-init.d/10-fixroutes.sh'
    # Recommended but not required (DHCP needs NET_ADMIN)
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN
    restart: unless-stopped
    networks:
      internal:
      lan:
        ipv4_address: 192.168.1.3

networks:
  internal:
  lan:
    name: lan
    driver: macvlan
    driver_opts:
      parent: br-lan.20
    ipam:
      config:
        - subnet: 192.168.1.0/24

CodePudding user response:

The documentation for compose-files states that:

... environment can use either an array or a map. ...

To make it (on a syntactical level) work, we can:

  • set it to an empty array explicitly: environment: [],
  • remove the line, or
  • comment-in the two lines afterwards.
  • Related