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

1.1k views Asked by At

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

1

There are 1 answers

0
nrs jayaram On

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