EFS volume not mounted on Docker container on Elastic Beanstalk

794 views Asked by At

I'm unable to mount an EFS volume on my Docker container running on Elastic Beanstalk. Here's what I have in Dockerrun.aws.json:

{
  "AWSEBDockerrunVersion": "1",
  "Volumes": [
    {
      "HostDirectory": "/mydir",
      "ContainerDirectory": "/mydir"
    }
  ]
}

Here's what I have in .ebextensions/storage-efs-mountfilesystem.config. The rest is the same as this.

option_settings:
  aws:elasticbeanstalk:application:environment:
    EFS_VOLUME_ID: 'fs-*****'
    EFS_MOUNT_DIR: '/mydir'

When I ssh into my Elastic Beanstalk environment, I see that the volume is mounted on the host:

[ec2-user@ip-****** app]$ df
Filesystem                                                  1K-blocks    Used        Available Use% Mounted on
us-east-1a.fs-******.efs.us-east-1.amazonaws.com:/ 9007199254740992       0 9007199254740992   0% /mydir

But in my Docker container, the filesystem is not EFS:

root@99046bd6a358:/reo# df
Filesystem                       1K-blocks    Used Available Use% Mounted on
/dev/xvda1                         8125880 1552688   6472924  20% /mydir

I do not have any VOLUME instructions in my Dockerfile.

Furthermore, if I created a file in my Docker container, that file does not exist when I go back to the host directory. Therefore, /mydir is not coming from the hosts volume. What else do I need to do access my EFS volume on Docker?

0

There are 0 answers