compose icon indicating copy to clipboard operation
compose copied to clipboard

Docker-compose modifying location of secrets files from Linux format to Windows format

Open swright573 opened this issue 4 years ago • 5 comments

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

  1. Rename docker-compose-example.yml.txt to docker-compose-example.yml
  2. Execute docker-compose -f docker-compose-example.yml config
  3. 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.

swright573 avatar Mar 31 '21 11:03 swright573

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.

stale[bot] avatar Nov 09 '21 20:11 stale[bot]

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?

kennedyw avatar Dec 30 '21 03:12 kennedyw

This issue has been automatically marked as not stale anymore due to the recent activity.

stale[bot] avatar Dec 30 '21 03:12 stale[bot]

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.

jslttery avatar Jun 13 '22 06:06 jslttery

Issue #7857 is related to this as well. but that one has the cursed stale label.

kmpm avatar Aug 25 '22 13:08 kmpm

This has been fixed by https://github.com/compose-spec/compose-go/issues/304

ndeloof avatar May 03 '23 11:05 ndeloof