![](/img/trans.png)
[英]ERROR: In file './docker-compose.yml', service must be a mapping, not a NoneType., how to solve this problem
[英]i keep getting "services.pihole.environment must be a mapping" while trying to run a docker container, is something wrong with my yml file?
嘗試使用 ssh 將以下代碼粘貼到 .yml 文件中以訪問運行 openWRT 的主機。 我通過 vim 復制了它,我是否有可能從復制中得到奇怪的縮進錯誤?
當我嘗試運行容器時,我收到“必須映射”錯誤消息,谷歌搜索后大多數人似乎說這是由於 yml 文件中的縮進錯誤。 如果下面的代碼看起來正確,那么我可以發送我執行的命令 rest。
有人可以幫我解決這個錯誤嗎?
更新:取消注釋時區修復了它,但我現在收到錯誤消息“清單列表條目中沒有與 linux/mipsle 匹配的清單”,這是什么意思?
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
撰寫文件的文檔指出:
...
environment
可以使用數組或 map。...
為了讓它(在句法層面上)起作用,我們可以:
environment: []
,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.