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.)
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With