Docker-compose modifying location of secrets files from Linux format to Windows format
- [x] I have tried with the latest version of Docker Desktop
- [ ] I have tried disabling enabled experimental features
- [x] I have uploaded Diagnostics
- Diagnostics ID: 4D222771-BA4E-4002-95B6-9687A3D0B171/20210331114224
Actual behavior
This is from my docker-compose yml file: secrets: secret_key: file: /run/secrets/secret_key.txt
This is what it looks like when run config against that file: secrets: secret_key: file: C:\run\secrets\secret_key.txt
Expected behavior
I think it should should leave the file location as I coded it. Why is it changing into a Windows-specific format? The reason this is an issue for me is that I'm using a remote context to use my docker-compose file to deploy to a server running Ubuntu so of course it can't find a file at C:\etc.. My remote deploy worked flawlessly until I tried to implement secrets (no swarm). :
secrets: secret_key: file: /run/secrets/secret_key.txt
Information
- Windows Version: Microsoft Windows 10 Pro 10.0.19042 Build 19042
- Docker Desktop Version: 3.2.2 (61853)
- WSL2 or Hyper-V backend? WSL2
- Are you running inside a virtualized Windows e.g. on a cloud server or a VM: No
docker-compose-example.yml.txt
Steps to reproduce the behavior
- Rename docker-compose-example.yml.txt to docker-compose-example.yml
- Execute docker-compose -f docker-compose-example.yml config
- Compare my secret file definitions with what is shown in the config output. You will see they've been converted from linux format to Windows format.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is blocking me currently. My similar situation is that I want to make a postgres replication cluster configured by docker. These postgres instances are not services in a swarm, but will participate in an overlay network with other applications in a swarm. With docker context set to the node that I want the standalone instance of postgres on and with secrets on my local, it complains about the path with this error. Is there a healthy way of securely getting these secrets into the containers via remote docker commands?
This issue has been automatically marked as not stale anymore due to the recent activity.
I've just run into this as well. It looks as if Docker is trying to find the path on the server machine rather than on the machine issuing the docker-compose command. If this is the expected behaviour, it would be good to have it explicitly documented at least.
Issue #7857 is related to this as well. but that one has the cursed stale label.
This has been fixed by https://github.com/compose-spec/compose-go/issues/304