我刚接触docker,在命令行中运行此脚本后遇到错误:
docker-compose up postgres-95 mysql-57为了给你提供更多的背景信息,我正在尝试为Sequelize做贡献,我遵循了https://github.com/sequelize/sequelize/blob/master/CONTRIBUTING.md#coding-guidelines的指示
ERROR: for mysql-57 Cannot start service mysql-57: Mounts denied:
The path /mnt/sequelize-mysql-ramdisk
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
Starting postgres-95 ... error
ERROR: for postgres-95 Cannot start service postgres-95: Mounts denied:
The path /mnt/sequelize-postgres-ramdisk
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.任何帮助都将不胜感激!
编辑:不知道这是否有帮助,但这里是docker-compose.yml:
# PostgreSQL
postgres-95:
image: sushantdhiman/postgres:9.5
environment:
POSTGRES_USER: sequelize_test
POSTGRES_PASSWORD: sequelize_test
POSTGRES_DB: sequelize_test
volumes:
- /mnt/sequelize-postgres-ramdisk:/var/lib/postgresql/data
ports:
- "8998:5432"
container_name: postgres-95
# MySQL
mysql-57:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: lollerskates
MYSQL_DATABASE: sequelize_test
MYSQL_USER: sequelize_test
MYSQL_PASSWORD: sequelize_test
volumes:
- /mnt/sequelize-mysql-ramdisk:/var/lib/mysql
ports:
- "8999:3306"
container_name: mysql-57发布于 2018-08-14 05:09:44
嘿,我遇到了同样的问题,似乎是由于权限问题。https://docs.docker.com/docker-for-mac/osxfs/#access-contro我是这样解决的:
sudo /mnt中写入来创建一个mnt目录(在我的例子中,我试图安装postgres,所以我必须运行sudo /mnt/postgres/data)。确保您是在根路径中创建它。/mnt目录!。希望它能工作!:)
发布于 2018-02-16 00:18:25
通过在根目录中创建mnt目录解决了我的问题。
https://stackoverflow.com/questions/48810170
复制相似问题