2

I created the following simple Dockerrun file per the instructions here using a public container and it's successfully running a single instance.

 {
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "sbeam/influxdb",
    "Update": "true"
  },
  "Ports": [
    {
      "ContainerPort": "8086"
    }
  ],
  "Volumes": [
    {
      "HostDirectory": "/data",
      "ContainerDirectory": "/data"
    }
  ]
}

However I want the /data directory to be mounted within the EC2 instance as a certain EBS volume. I've found answers (here and here) that indicate a .ebextensions is needed, but since I am not uploading a .zip image for the container, how is this possible? Is it necessary to download the Docker container, add the .ebextensions directory, zip and re-upload?

Community
  • 1
  • 1
sbeam
  • 4,622
  • 6
  • 33
  • 43
  • I'm not sure I understood concerning the zip... Do you mean you don't provide the zip file and use `eb deploy` to deploy? If you have a `.ebextensions` folder in your repository it will push the content to your beanstalk environment with the rest. – Céline Aussourd Dec 10 '14 at 11:07
  • I mean I am using Dockerrun.aws.json as detailed in the first link. Not using the command-line but the web UI. So that's all there is in the upload, just one file, no place to put a directory. – sbeam Dec 10 '14 at 17:53

1 Answers1

-1

You will have to follow option 3: "Create a .zip file containing your application files, any application file dependencies, the Dockerfile, and the Dockerrun.aws.json file." as explained in your first link.

In your case the .zip file may only contain the Dockerrun.aws.json and the .ebextensions folder.

In order to attach the EBS volume to your instance, you can check this article: http://blogs.aws.amazon.com/application-management/post/Tx224DU59IG3OR9/Customize-Ephemeral-and-EBS-Volumes-in-Elastic-Beanstalk-Environments. It will give you indications concerning the content of the .config file that will be inside the .ebextensions folder

Céline Aussourd
  • 10,214
  • 4
  • 32
  • 36