Docker Community Forums

Share and learn in the Docker community.

Autofs configuration in docker image


(Kumarprd) #1

I am trying to build an image, where some automated scripts will run that will access files from NFS share. I use oraclelinux 6.7 as OS image.

I am facing issue while configuring autofs OR NFS from Dockerfile.

Have anyone configured it successfully ?


(Tr2docker) #2

I am having the same problem. Has the issue been resolved?


(Tr2docker) #3

Actually, I have this fixed. I had to basically copy my autofs mounts to the image via:
ADD mnt /mnt
(This was after I copied my /mnt to a local mnt directory)

There is probably a better way of doing this, but couldn’t find one. Starting the container to map the container’s /mnt to the host’s /mnt could have been done, but I need to install packages at image build time, not at container run time, so making sure my mounts were configured at image build time was necessary.
Any suggestions on a better way of doing this?