Skip to content

Question: Are docker-compose secrets supported on Windows Containers? #4829

Closed

Description

@JonJam

Hi,

I am trying to get secrets working with a service using Docker for Windows with Windows Containers, my top level compose file (Can add overrides if necessary) below:

version: '3.1'

secrets:
web_connectionstring:
file: .\docker-secrets\web_connectionstring

services:
web:
image: jonjam/web:latest
secrets:
- web_connectionstring

When I build I get the following error:
Cannot create container for service web: invalid volume spec "/run/secrets/web_connectionstring": invalid volume specification: '\run\secrets\web_connectionstring'

Hence my question are secrets supported on Windows Containers? Or am I missing something.

Activity

  1. shin- commented on May 16, 2017

    @shin-

    It's still a work in progress on the engine's end: moby/moby#32208

    After that, there'll probably be more work needed for docker-compose to support it, so it might not come simultaneously (but if you deploy with docker stack deploy instead, it will be available)

    cc @dnephin

  2. JonJam commented on May 16, 2017

    @JonJam
    Author

    @shin- Thanks a lot for confirming this 👍.

    I spent a lot of time today trying to work out what I was doing wrong. As Windows Containers become more mainstream, it might be good idea on docker documentation to state whether a feature is supported with Windows containers.

  3. caphrim007 commented on Oct 3, 2017

    @caphrim007

    @shin- I think i am receiving the same error, but it looks (on my end) like the secrets are just not being translated to their unix-y paths.

    here's a snippet from docker-compose config

    secrets:
      clouds.yaml:
        file: C:\Users\tim\f5-ansible\devtools\secrets\clouds.yaml
    ....
        secrets:
        - source: cloudsyaml
          target: clouds.yaml
        volumes:
        - /c/Users/tim/f5-ansible:/here:rw
    version: '3.3'
    

    Note that the volumes are translated fine, just the secrets are not. This is with COMPOSE_CONVERT_WINDOWS_PATHS=1 set.

    Am I seeing the same thing that @JonJam is seeing?

  4. mikeblakeuk commented on May 4, 2018

    @mikeblakeuk

    Any news on this? @shin / @dnephin

  5. Scofield62 commented on Dec 10, 2018

    @Scofield62

    I am also interested in this. I am facing with this issue on Docker Toolbox. :( It is just working fine on docker for windows (as linux containers)

  6. daaan commented on Jan 2, 2019

    @daaan

    Same issue here.

    I spent a lot of time today trying to work out what I was doing wrong. As Windows Containers become more mainstream, it might be good idea on docker documentation to state whether a feature is supported with Windows containers.

    @JonJam I would also like a (more useful) runtime notice if a feature is used that is not fully implmented yet. Or perhaps even better: don't release fully implemented features.

  7. EntityB commented on Jan 5, 2019

    @EntityB

    @Scofield62 I didn't manage to make secrets work with docker-compose and Docker Toolbox. I think main problem is Docker Toolbox doesn't support docker-compose 3.1 well. And you need 3.1 (3.0 didn't support secrets). I suggest to you to buy Windows Pro on Ebay for 4$.

    From what can I share with others:
    Secrets works for me on Windows Pro with Docker 18.09.0, build 4d60db4and docker-compose version 1.23.2 BUT only if I cast docker-compose from cmd. From linux subsystem it doesn't work, also doesn't work from windows powershell, where I get error:

    ERROR: for <service> Cannot start service <service>: error while creating mount source path '/host_mnt/c/.../.secrets/mysecret.json': mkdir /host_mnt/c: file exists
    

    Once part with secret is removed from my docker-compose, it works everywhere.

  8. jpcmadeira commented on Apr 9, 2019

    @jpcmadeira

    @shin- I think i am receiving the same error, but it looks (on my end) like the secrets are just not being translated to their unix-y paths.

    here's a snippet from docker-compose config

    secrets:
      clouds.yaml:
        file: C:\Users\tim\f5-ansible\devtools\secrets\clouds.yaml
    ....
        secrets:
        - source: cloudsyaml
          target: clouds.yaml
        volumes:
        - /c/Users/tim/f5-ansible:/here:rw
    version: '3.3'
    

    Note that the volumes are translated fine, just the secrets are not. This is with COMPOSE_CONVERT_WINDOWS_PATHS=1 set.

    Am I seeing the same thing that @JonJam is seeing?

    I have a fix for the secrets path conversion. I still might have to use the env variable COMPOSE_CONVERT_WINDOWS_PATHS so compose doesn't convert paths when using windows containers but its working for linux containers, which was my problem.
    Fix: #6595

  9. mara8008 commented on Sep 23, 2019

    @mara8008

    Is there any work around available that docker compose 3.5 secrets work with docker toolbox 19.03.1 on Windows 8?

    I see the same issue as @JonJam mentioned.

  10. stale commented on Mar 21, 2020

    @stale

    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.

  11. stale commented on Mar 28, 2020

    @stale

    This issue has been automatically closed because it had not recent activity during the stale period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions