Mount NFS device


#1

Hello,
how can I mount an nfs device inside the container? The container has an local IP-address.

  • 192.168.0.13 NFS-Server
  • 192.168.0.20 Resin Docker Server
  • NFS Server allowes 192.168.0.20 to access /volume1/upload

I can mount the /volume1/upload on the resin server (terminal), but I can’t mount within the docker container

RUN bash -c ‘mount -t nfs -v -o nolock 192.168.0.13:/volume1/upload /media/video’
–>
[Build] mount.nfs: trying text-based options ‘nolock,vers=4,addr=192.168.0.13,clientaddr=172.18.0.2’
[Build] mount.nfs: trying text-based options ‘nolock,addr=192.168.0.13’

The docker container has an internal IP 172.18.0.2 ?

Or can I mount the nfs-share on the host and export directories into the docker container?


#2

Hello,

What do you mean resin server? Have you downloaded the resinOS (from https://resinos.io) or you are referring to the resin platform?

Does this section help? https://docs.resin.io/runtime/runtime/#mounting-external-storage-media

Cheers,
ilias


#3

Hello ilias,
yes, it runs an Resin OS 2.0.0+rev3 on an raspberry pi zero (my resin server)
Mounting external storage is for sd-cards and usb sticks, not for nfs servers?

Thomas


#4

Hello Thomas,
I’ll ask the team and an engineer with more experience in nfs will come back to you.


#5

OK, I’m confused.

I can mount the nfs volume, when I call the terminal inside the dashboard.resin.io. After that I can e.g. browse the directory from the running docker app. ( I run sabnzbdplus as a docker app and browse during web interface)

This works for me. Thank you.


#6

So, you cannot mount the nfs volume at build time (i.e. in your dockerfile). But if you can mount the nfs volume when you open the web terminal (from your resin.io dashboard) then you should be able to run the same command in a script at boot time. So you can create a script and put a RUN command at the end of your dockerfile.


#7

Ah, ok. This helps. Thank you.