I am running docker compose command to run the app in docker. But, volumes defined in yml are empty. If I mount a single file, it is working. But, when I mount a directory from windows, I can see the directory, but it is empty.
This is my docker-compose command.
docker-compose -f docker-compose.dev.yml -f docker-compose.test.yml -f docker-compose.test.local.yml run --rm app /bin/sh
Below is the content of my yml file:
version: "3"
services:
app:
environment:
- NODE_ENV=test
- TEST_DB_HOSTNAME=database
- DB_HOSTNAME=database
- DB_MIGRATE_ENV=test-docker
volumes:
- .jshintignore:/home/test_app/src/.jshintignore
- .jshintrc:/home/test_app/src/.jshintrc
- ./nuke-rebuild-test-db.js:/home/gofar/src/nuke-rebuild-test-db.js
- ./test_folder:/home/test_app/src/test_folder
- ./database:/home/test_app/src/database
- ./server:/home/test_app/src/server
- ./common:/home/test_app/src/common
- ./coverage:/home/test_app/src/coverage
From above, nuke-rebuild-test-db.js file gets copied into container. I can see test_folder too. But, if I look inside the folder it is empty.
Below are what I have done to make docker work in my Windows 10 Home system where I have docker toolbox.
Below is the config that connects my Ubuntu WSL in my windows machine with Docker Toolbox.
For my root directory to be compatible with linux, I have added following to /etc/wsl.conf fiel
[automount]
root = /
options = "metadata"
I have added my application folder in Shared Folders list in Oracle VM Virtual Box too even though the single files are being mounted.
Thanks.