Docker does not support storing secrets on Windows home system using Docker toolbox
Asked Answered
C

1

6

Using Docker toolbox on Windows 10 Home, Docker version 19.03, we have created a docker-compose.yml and added a secrets file as JSON, it runs fine on a Mac system, but it is unable to run the same in Windows 10 Home.

Error after running docker-compose up:

ERROR: for orthancserver  Cannot create container for service orthanc: invalid mount config for type 
"bind": invalid mount path: 'C:/Users/ABC/Desktop/Project/orthanc.json' mount path must be absolute

docker-compose.yml:

version: "3.7"

services: 
    orthanc:
        image: jodogne/orthanc-plugins:1.6.1
        command: /run/secrets/
        container_name: orthancserver
        restart: always
        ports: 
            - "4242:4242"
            - "8042:8042"
        networks: 
            - mynetwork
        volumes: 
            - /tmp/orthanc-db/:/var/lib/orthanc/db/
        secrets:
            - orthanc.json    
    dcserver:
        build: ./dc_node_server
        depends_on:
            - orthanc
        container_name: dcserver
        restart: always
        ports: 
            - "5001:5001"
        networks: 
            - mynetwork
        volumes: 
            - localdb:/database    
volumes:
    localdb:
        external: true
networks: 
    mynetwork:
        external: true
secrets:
    orthanc.json:
        file: orthanc.json

orthanc.json file kept next to docker-compose.yml

Cousteau answered 14/5, 2020 at 6:44 Comment(4)
I guess you are using linux containers, so you need to share drives in windows to linux containers to this works. Hope this help docs.docker.com/docker-for-windows/#file-sharingGroundsheet
See github.com/docker/compose/issues/4829 Question: Are docker-compose secrets supported on Windows Containers?Joleenjolene
@Schwarz54, Yes, you are right, using Linux container at VM from windows Toolbox. I have tried this shared dir, but still not works for secretes. but adding at volume works fine, see my other question with updated docker-compose.yml https://mcmap.net/q/1918926/-dicom-send-error-horos-not-sending-files-to-orthanc-docker-containers/2034750Cousteau
@RajSrujanJalem, Its not answered still, and its for older version of docker-compose. so looking for latest version of docker-composeCousteau
C
0

Found an alternative solution for windows 10 home, with docker toolbox. as commented by @Schwarz54, the file-sharing works well with docker volume for Dockerized Orthanc server.

Add shared folder:

  1. Open Oracle VM manager
  2. Go to setting of default VM
  3. Click Shared Folders
  4. Add C:\ drive to the list

Edit docker-compose.yml to transfer the config file to Orthanc via volume

version: "3.7"

services: 
    orthanc:
        image: jodogne/orthanc-plugins:1.6.1
        command: /run/secrets/
        container_name: orthancserver
        restart: always
        ports: 
            - "4242:4242"
            - "8042:8042"
        networks: 
            - mynetwork
        volumes: 
            - /tmp/orthanc-db/:/var/lib/orthanc/db/
            - /c/Users/ABCUser/Desktop/Project/orthanc.json:/etc/orthanc/orthanc.json:ro
    dcserver:
        build: ./dc_node_server
        depends_on:
            - orthanc
        container_name: dcserver
        restart: always
        ports: 
            - "5001:5001"
        networks: 
            - mynetwork
        volumes: 
            - localdb:/database    
volumes:
    localdb:
        external: true
networks: 
    mynetwork:
        external: true
Cousteau answered 21/5, 2020 at 14:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.