0

I am wondering if AWS Beanstalk supports docker data volumes or does it only support host volumes? I am reading the beanstalk documentation and I see that Volumes in the Dockerrun.aws.json is for the EC2 directories (host). I then figured a docker data volume must simply be a separate container for housing data but when I read this in the docker documentation:

Create and manage volumes
Unlike a bind mount, you can create and manage volumes outside the scope of any container.

To me that indicates that a data volume is NOT a container. With that said, how can I create one using elastic beanstalk if Volumes is for host directories and a docker volume is different than a container? Is this not supported?

Basically I want elastic beanstalk to do this:

$ docker volume create --name nexus-data
$ docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3

using the config:

{
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "someimage:latest",
    "Update": "true"
  },
  "Ports": [
    {
      "ContainerPort": "8081"
    }
  ],
  "Volumes": [
    {
      "nexus-data": "/nexus-data" <-- This is for host = Wrong!
    }
  ],
  "Logging": "/var/log/nginx"
}
  • If you want to persist data in Beanstalk for container you may have to use S3 or EFS. Have you looked at Amazon Elastic Container Service to run your container? I feel this documentation is quite explanatory to help you understand how you can use volumes for different use-cases. It even allows you to use volumes from another container (the quite old way used to persist data). – Miguel A. C. Jan 20 '18 at 7:55
  • Thanks @MiguelA.C., I am starting to realize S3 is the way to go. I'll just have to use some plugin. I do have to stick with elastic beanstalk because of orginaztional reqs but I'll look into it. – S1r-Lanzelot Jan 20 '18 at 11:05
  • Why do you need docker volume? What are are trying to solve? – ALex_hha Jan 26 '18 at 8:16
  • If you are insistent on using docker containers, general consensus is to use EC2/ECS on AWS. Elastic Beanstalk effectively mimics containerization for people who don't use Docker yet – emporerblk Sep 15 '18 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.