[英]MacOS - In file './docker-compose.yml', volume must be a mapping, not an array
I've seen responses for similar errors, but nothing that seems to address a solution that will work for me. 我已经看到了针对类似错误的回复,但是似乎没有什么能够解决对我有用的解决方案。
I've got a wordpress site that I've imported into docker following this tutorial . 在本教程之后 ,我有一个wordpress网站已导入docker。 I've got everything down to the final part where I'm supposed to "docker compose up" and I'm getting the error listed in the subject line.
我已经把所有事情都归结到了我应该“码头工人组成”的最后一部分,并且在主题行中列出了错误。 Here is my .yml file:
这是我的.yml文件:
version: "2"
services:
db:
image: mysql:5.6
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
- ./public_html/wp-content/themes/oceanwp:/var/www/html/wp-content/themes/oceanwp
- ./public_html/wp-content/plugins:/var/www/html/wp-content/plugins
- ./public_html/wp-content/mu-plugins:/var/www/html/wp-content/mu-plugins
volumes:
- ./data:/docker-entrypoint-initdb.d
I was wondering why your yml file is different from the one in the post . 我想知道为什么您的yml文件与文章中的文件不同。 I use the yml file in the post and it does work.
我在帖子中使用yml文件,它确实起作用。
Remember that you can't map a top-level volume in docker-compose , so blow is illegal, see link and link for more help. 请记住,您无法在docker-compose中映射顶级卷,因此打击是非法的,请参阅链接和链接以获取更多帮助。
volumes: - ./data:/docker-entrypoint-initdb.d
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.