[英]In file './docker-compose.yml', service 'image' must be a mapping not a string
[英]In file './docker-compose.yml', service 'proxy-nginx' must be a mapping not a string?
我有以下docker-compose.yml
文件:
version: '3'
services:
proxy-nginx:
build:./nginx
ports:
- 80:80
當我運行docker-compose up控制台日志時:
In file './docker-compose.yml', service 'proxy-nginx' must be a mapping not a string.
該答案建議在端口周圍使用引號:
version: '3'
services:
proxy-nginx:
build:./nginx
ports:
- "80:80"
還嘗試縮進端口:
version: '3'
services:
proxy-nginx:
build:./nginx
ports:
- 80:80
但是結果仍然是一樣的。 有任何想法嗎?
嘗試正確縮進端口 :
version: '3'
services:
gogs-nginx:
build: ./nginx
ports:
- "80:80"
我認為問題在於解析器認為端口由於誤導性縮進而是另一項服務。 我不能為此怪。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.