在哪里放置ebextensions配置在AWS弹性Beanstalk Docker部署与dockerrun源码包? [英] Where to put ebextensions config in AWS Elastic Beanstalk Docker deploy with dockerrun source bundle?

查看:190
本文介绍了在哪里放置ebextensions配置在AWS弹性Beanstalk Docker部署与dockerrun源码包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的Docker弹性beanstalk部署到我的.ebextensions / setup.config文件,我遇到麻烦。eb环境配置说:


您可以在源包中包含一个或多个配置文件。配置文件必须以扩展名.config(例如myapp.config)命名,并放在源包中的.ebextensions顶级目录中。


然而,Docker看起来源包不是一个 .zip .war 文件,但是一个 .json 文件,例如,文档对创建一个Dockerrun.aws.json文件,并且它看起来像源代码包?



在创建应用程序的版本我将自定义的 Dockerrun- $ VERSION.aws.json 文件上传到s3,运行类似于以下内容(其中 $ APP 是版本的dockerrun json文件):

  aws elasticbeanstalk create-application-version \ 
- 应用名称$ APP_NAME \
--version-label $ VERSION \
--source-bundle S3 Bucket = $ S3_BUCKET,S3Key = $ S3_PATH / $ APP

所以...如何.ebextensions目录当捆绑只是一个最终构建容器的json文件时,可以在源包的顶级目录中找到它们。 (我的第一次尝试是把它放在项目的根目录中,但是没有起作用。)

解决方案

如果您正在使用.json文件进行docker部署,那么您不能使用.ebextensions。



然而,您可以创建包含.json和.ebextension目录的zip,一切都应该奏效使用zip作为您的部署工件而不是raw json。


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.)

解决方案

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.

这篇关于在哪里放置ebextensions配置在AWS弹性Beanstalk Docker部署与dockerrun源码包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆