Using AWS EFS with Docker

后端 未结 3 526
不思量自难忘°
不思量自难忘° 2021-01-02 03:09

I am using the new Elastic File System provided by amazon, on my single container EB deploy. I can\'t figure out why the mounted EFS cannot be mapped into the container.

3条回答
  •  旧巷少年郎
    2021-01-02 03:14

    You need to restart docker after mounting the EFS volume in the host EC2 instance.

    Here's an example, .ebextensions/efs.config:

    commands:
       01mkdir:
          command: "mkdir -p /efs-mount-point"
       02mount:
          command: "mountpoint -q /efs-mount-point || mount -t nfs4 -o nfsvers=4.1 $(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone).fs-fa35c253.efs.us-west-2.amazonaws.com:/ /efs-mount-point"
       03restart:
          command: "service docker restart"
    

提交回复
热议问题