3

Trying to set up docker so that when I change my project files on my windows machine they are updated in my docker container. From this question I learned that you should use the volumes setting in the docker-compose.yml file.

But I still can't get it to work.

I have tried to set the volumes to (+30 similar combinations):

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

I have also tried adding a .env file with:

COMPOSE_CONVERT_WINDOWS_PATHS=1
COMPOSE_CONVERT_WINDOWS_PATHS=0

When I do docker-compose up

and set volumes to .:/home/app/angular-seed I get:

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.

When I set volumes to /c/Users/dev/angular-seed:/home/app/angular-seed I get: ...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.

When I set it to C:/User/k/dev/angular-seed I get ...invalid volume specification...

I have checked that Oracle VM Virtual Box Manager have shared folders (Machine Folders) set to: c/Users \\?\c:\Users (auto mount) yes (Access) full

Other responses I have seen are everything from:

    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"

to

[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.

to

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.

to

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.
Community
  • 1
  • 1
Kriss
  • 326
  • 1
  • 3
  • 12

1 Answers1

0

Try these lines in your docker-compose.yml file:

volumes:
  - /c/Users/k/dev/angular-seed:/home/app/angular-seed
Lutz Büch
  • 343
  • 4
  • 12