在docker-compose.yml文件中为Windows 10 home设置卷
尝试设置泊坞窗,以便当我更改我的Windows计算机上的项目文件,他们在我的docker容器更新。 从这个问题我知道你应该使用docker-compose.yml文件中的卷设置。
但是我仍然无法工作。
我试图设置音量(+30相似的组合):
volumes: - x .:/home/app/angular-seed //c/Users/k/dev/angular-seed/:/home/app/angular-seed c/Users/k/dev/angular-seed:/home/app/angular-seed C:/User/k/dev/angular-seed
我也尝试添加一个.env文件:
COMPOSE_CONVERT_WINDOWS_PATHS=1 COMPOSE_CONVERT_WINDOWS_PATHS=0
当我做docker-compose up
并将卷设置为.:/home/app/angular-seed
我得到:
ERROR: for angular-seed Cannot create container for service angular-seed: invalid bind mount spec "C:\\Users\\k\\dev\\angular-seed:/home/app/angular-seed:rw": invalid volume specification: 'C:\Users\k\dev\angular-seed:/home/app/angular-seed:rw' [31mERROR[0m: Encountered errors while bringing up the project.
当我将卷设置为/c/Users/dev/angular-seed:/home/app/angular-seed
我得到: ...includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host directory, use absolute path.
...includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host directory, use absolute path.
当我把它设置为C:/User/k/dev/angular-seed
我得到...invalid volume specification...
我已经检查过Oracle VM Virtual Box Manager共享文件夹(Machine Folders)设置为: c/Users \\?\c:\Users (auto mount) yes (Access) full
我所看到的其他回答是:
Recreating angular-seed-start Attaching to angular-seed-start [36mangular-seed-start |[0m npm info it worked if it ends with ok [36mangular-seed-start |[0m npm info using npm@3.10.3 [36mangular-seed-start |[0m npm info using node@v6.6.0 [36mangular-seed-start |[0m npm info lifecycle angular-seed@0.0.0~prestart: angular-seed@0.0.0 [36mangular-seed-start |[0m npm info lifecycle angular-seed@0.0.0~start: angular-seed@0.0.0 [36mangular-seed-start |[0m [36mangular-seed-start |[0m > angular-seed@0.0.0 start /home/app/angular-seed [36mangular-seed-start |[0m > gulp serve.dev --color [36mangular-seed-start |[0m [36mangular-seed-start |[0m sh: 1: gulp: not found [36mangular-seed-start |[0m [36mangular-seed-start |[0m npm info lifecycle angular-seed@0.0.0~start: Failed to exec start script [36mangular-seed-start |[0m npm ERR! Linux 4.4.43-boot2docker [36mangular-seed-start |[0m npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
至
[31mERROR[0m: Named volume "c/Users/k/dev/angular-seed:/home/app/angular- seed:rw" is used in service "angular-seed" but no declaration was found in the volumes section.
至
Recreating 90b0444c8ee3_90b0444c8ee3_90b0444c8ee3_90b0444c8ee3_angular-seed-start ERROR: for angular-seed Cannot create container for service angular-seed: invalid bind mount spec "C:\\Users\\k\\dev\\angular-seed\\dev\\angular-seed:/home/app/angular-seed:rw": invalid volume specification: 'C:\Users\k\dev\angular-seed\dev\angular-seed:/home/app/angular-seed:rw' [31mERROR[0m: Encountered errors while bringing up the project.
至
Recreating 90b0444c8ee3_90b0444c8ee3_90b0444c8ee3_angular-seed-start ERROR: for angular-seed Cannot create container for service angular-seed: create \c\Users\k\dev\angular-seed: "\\c\\Users\\k\\dev\\angular-seed" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intented to pass a host directory, use absolute path [31mERROR[0m: Encountered errors while bringing up the project.