实际上,对于我在Windows 10上的开发环境(而不是整个文件),我有类似的东西:
db:
image: mysql:5.6
ports:
- "3307:3306"
environment:
- "MYSQL_ROOT_PASSWORD=password"
- "MYSQL_USER=root"
- "MYSQL_PASSWORD=password"
- "MYSQL_DATABASE=simtp"
engine:
build: ./docker/engine/
volumes:
- "c:/working_directory/simtp:/var/www/docker:rw"
- "c:/working_directory/simtp/docker/engine/php.ini:/usr/local/etc/php/conf.d/custom.ini:ro"
links:
- "db:db"
working_dir: "/var/www/simtp"
问题出在Windows路径上。 我该怎么办呢?当我在生产中运行docker-compose时,我将确定会收到错误。
感谢。
答案 0 :(得分:1)
在docker-compose.yml中使用相对路径:
db:
image: mysql:5.6
ports:
- "3307:3306"
environment:
- "MYSQL_ROOT_PASSWORD=password"
- "MYSQL_USER=root"
- "MYSQL_PASSWORD=password"
- "MYSQL_DATABASE=simtp"
engine:
build: ./docker/engine/
volumes:
- "./:/var/www/docker:rw"
- "./docker/engine/php.ini:/usr/local/etc/php/conf.d/custom.ini:ro"
links:
- "db:db"
working_dir: "/var/www/simtp"
指示他们将docker-compose.yml文件放在c:/working_directory/simtp
或其文件所在的位置
问候