I have a database that gets created in C:\app in the container. I want to map that to a local file in C:\dockerstuff on my Windows 2016 server host, what is the correct syntax for the “volumes:” attribute in my yaml file?
I have tried every possible combination I could think of and they all fail with some variation of “invalid volume spec”. When I comment out the “volumes” attribute, I can see mydatabase.db in the container in the C:\app directory.
Host: Windows 2016 Server Standard
Docker: 17.06.2-ee-16, build 9ef4f0a
Docker-compose: 1.23.0-rc1, build 320e4819
Here’s my yaml file.
version: ‘3.6’
services:
test:
hostname: test
environment:
- ASPNETCORE_ENVIRONMENT=ProductionDocker
- ASPNETCORE_URLS=http://+:80
- DB__Type=litedb
- DB__File=mydatabase.db
- COMPOSE_CONVERT_WINDOWS_PATHS=1
image: testreg.io/testwin:latest
ports:
- “8081:80”
volumes:
- c:\dockerstuff:c:\app