How to mount EFS inside a docker container?

后端 未结 1 575
暗喜
暗喜 2020-12-20 10:29

I am trying to mount EFS inside a docker container running on EC2 server. EFS mount in EC2 is working fine with,

sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048         


        
相关标签:
1条回答
  • 2020-12-20 11:11

    You can create a docker volume using EFS:

    docker volume create \
        --driver local \
        --opt type=nfs \
        --opt o=addr=10.0.0.50,rw,nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 \
        --opt device=:/ efs 
    

    Then mount the volume docker run --rm -it -v efs:/mnt ubuntu:18.04.

    0 讨论(0)
提交回复
热议问题