Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put ebextensions config in AWS Elastic Beanstalk Docker deploy with dockerrun source bundle?

Tags:

I am having trouble getting my docker elastic beanstalk deploy to read my .ebextensions/setup.config file.

The documentation for eb environment configuration says:

You can include one or more configuration files with your source bundle. Configuration files must be named with the extension .config (for example, myapp.config) and placed in an .ebextensions top-level directory in your source bundle.

However it looks like for Docker that the source bundle is not a .zip or .war file, but a .json file, e.g., the docs say to create a Dockerrun.aws.json file—and it looks like that is the source bundle?

In creating a version of the app I upload a custom Dockerrun-$VERSION.aws.json file to s3 and the run something like the following (where $APP is the versioned dockerrun json file):

aws elasticbeanstalk create-application-version \     --application-name $APP_NAME \     --version-label $VERSION \     --source-bundle S3Bucket=$S3_BUCKET,S3Key=$S3_PATH/$APP 

So… how is the .ebextensions directory going to be found in the top-level directory of the source bundle when the “bundle” is just a json file that ends up building a container? (My first attempt was to just put it in the root of the project, but that didn’t work.)

like image 344
MrColes Avatar asked Jun 18 '15 19:06

MrColes


People also ask

Where should an Elastic Beanstalk configuration files?

ebextensions, see the Elastic Beanstalk Configuration Files Repository . Location – Place all of your configuration files in a single folder, named . ebextensions , in the root of your source bundle.

How do you deploy a Docker container in Elastic Beanstalk?

Deploy to the Cloud Using the Elastic Beanstalk Console Choose “AWS Cloud9” and “Go To Your Dashboard.” Choose “Services” and “Elastic Beanstalk.” At the top right, choose “Create Application.” Paste flask-app for the “Application Name.” For “Platform,” choose “Docker.” Leave the Docker settings as is.


1 Answers

If you are using a .json file for docker deploys, then you cannot use .ebextensions.

You can however create a zip that contains your .json and your .ebextension directory and everything should work. Use the zip as your deployment artifact instead of the raw json.

like image 106
Nick Humrich Avatar answered Nov 02 '22 23:11

Nick Humrich