Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem on mounting shared volume #54

Open
OkenKhuman opened this issue Jul 10, 2020 · 3 comments
Open

problem on mounting shared volume #54

OkenKhuman opened this issue Jul 10, 2020 · 3 comments

Comments

@OkenKhuman
Copy link

OkenKhuman commented Jul 10, 2020

I'm trying to mount a network shared directory for shareing html files and certificates. I'm using the below setup

version: '3.8'
services:
    nfs:
        image: erichough/nfs-server
        restart: unless-stopped
        environment:
            - NFS_EXPORT_0='/share/data0                  *(rw,no_subtree_check)'
            - NFS_EXPORT_1='/share/data1                  *(rw,no_subtree_check)'
        volumes:
            - ./html1:/share/data1
            - /certs/etc/letsencrypt/live:/share/data0
    proxy:
        image: nginx
        restart: unless-stopped
        depends_on:
            - nfs
        ports:
          - '80:80'
          - '443:443'
        volumes:
           - ./conf_data/proxy_template:/etc/nginx_templates
           - share1:/www/data1
           - share0:/etc/letsencrypt/live
    web_1:
        image: httpd
        restart: unless-stopped
        depends_on:
            - proxy
        volumes:
            - ./conf_data/mqtt_conf/mosquitto.conf:/mosquitto/config/mosquitto.conf
            - ./conf_data/mqtt_conf/more/:/mosquitto/config/more/
volumes:
    share0:
        type: "nfs"
        o: "addr=nfs,nolock,soft,rw"
        device: ":/share/data0"
    share1:
        type: "nfs"
        o: "addr=nfs,nolock,soft,rw"
        device: ":/share/data1"

but when I try to run using docker-compose up it gave me error as

ERROR: The Compose file './docker-compose.yml' is invalid because:
volumes.share0 value 'device', 'o', 'type' do not match any of the regexes: '^x-'
volumes.share1 value 'device', 'o', 'type' do not match any of the regexes: '^x-'

what can be the volume setup to mount the nfs shared?

please provide an example to mount the volume in compose setup

@jjwong0915
Copy link

@OkenKhuman
Your docker-compose.yml seems having incorrect syntax.
Please refer the driver_opts section in docker-compose file reference.
(link: https://docs.docker.com/compose/compose-file/#driver_opts)

@garanews
Copy link

garanews commented Feb 4, 2021

I tried docker-compose provided here, adding the "driver_opts:" directive but having this issue:

Creating ehough_nfs_1 ... done
Creating ehough_proxy_1 ... error

ERROR: for ehough_proxy_1  Cannot create container for service proxy: error resolving passed in network volume address: lookup nfs on 127.0.0.53:53: read udp 127.0.0.1:38094->127.0.0.53:53: i/o timeout

ERROR: for proxy  Cannot create container for service proxy: error resolving passed in network volume address: lookup nfs on 127.0.0.53:53: read udp 127.0.0.1:38094->127.0.0.53:53: i/o timeout
ERROR: Encountered errors while bringing up the project.

@garanews
Copy link

@ehough any idea about this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants