运行docker-compose后,我在文件夹(例如)laravel中运行docker exec <image> bash
。这个文件夹在我的电脑上是空的,但是在另外3台机器上,这个文件夹包含同步文件夹。
有任何想法可以解决这个问题,或者有人有同样的问题吗?
搬运工-compose.yml:
version: '2'
services:
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-70
volumes_from:
- application
expose:
- "9000"
links:
- workspace
application:
build: ./application
volumes:
- ./application/:/var/www/laravel
data:
build: ./data
volumes:
- /var/lib/mariadb:/var/lib/mariadb
- /var/lib/redis:/data
nginx:
build: ./nginx
volumes_from:
- application
volumes:
- ./logs/nginx/:/var/log/nginx
ports:
- "80:80"
- "443:443"
links:
- php-fpm
mariadb:
build: ./mariadb
volumes_from:
- data
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: taplend
MYSQL_USER: taplend
MYSQL_PASSWORD: 123
MYSQL_ROOT_PASSWORD: 123
redis:
build: ./redis
volumes_from:
- data
ports:
- "6379:6379"
beanstalkd:
build: ./beanstalkd
ports:
- "11300:11300"
privileged: true
links:
- php-fpm
beanstalkd-console:
build: ./beanstalkd-console
ports:
- "2080:2080"
links:
- beanstalkd
workspace:
build:
context: ./workspace
args:
INSTALL_PRESTISSIMO: ${INSTALL_PRESTISSIMO}
volumes_from:
- application
tty: true
每个服务在根目录中都有自己的目录。每个目录都有自己的 Dockerfile
PS:我将操作系统更改为 Windows 10 Pro ,并且文件夹通过dockerTools(docker beta没有同步文件夹)变为同步。我认为,主题必须关闭
答案 0 :(得分:0)
检查“共享驱动器”设置 - 在Windows和Mac上,默认情况下,只能共享某些路径中的目录。
有关适用于Windows的新Docker,请参阅此处:https://docs.docker.com/docker-for-windows/#/shared-drives
同时执行docker inspect {container}
(see docs)并查找装载/音量信息。