在哪里将 ebextensions 配置放在 AWS Elastic Beanstalk Docker 部署与 dockerrun 源包?
Where to put ebextensions config in AWS Elastic Beanstalk Docker deploy with dockerrun source bundle?
我无法让我的 docker elastic beanstalk 部署来读取我的 .ebextensions/setup.config 文件。
eb environment configuration 的文档说:
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.
但是对于 Docker 来说,源包看起来不是 .zip
或 .war
文件,而是 .json
文件,例如,文档说create a Dockerrun.aws.json file——看起来这是源包?
在创建应用程序版本时,我将自定义 Dockerrun-$VERSION.aws.json
文件上传到 s3 和 运行 类似以下内容(其中 $APP
是版本化的 docker 运行 json 文件):
aws elasticbeanstalk create-application-version \
--application-name $APP_NAME \
--version-label $VERSION \
--source-bundle S3Bucket=$S3_BUCKET,S3Key=$S3_PATH/$APP
那么……当“包”只是一个最终构建容器的 json 文件时,如何在源包的顶级目录中找到 .ebextensions 目录? (我的第一次尝试只是将它放在项目的根目录中,但没有成功。)
如果您使用 .json 文件进行 docker 部署,则不能使用 .ebextensions。
但是您可以创建一个包含您的 .json 和您的 .ebextension 目录的 zip,一切都应该有效。使用 zip 作为部署工件而不是原始 json.
我无法让我的 docker elastic beanstalk 部署来读取我的 .ebextensions/setup.config 文件。
eb environment configuration 的文档说:
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.
但是对于 Docker 来说,源包看起来不是 .zip
或 .war
文件,而是 .json
文件,例如,文档说create a Dockerrun.aws.json file——看起来这是源包?
在创建应用程序版本时,我将自定义 Dockerrun-$VERSION.aws.json
文件上传到 s3 和 运行 类似以下内容(其中 $APP
是版本化的 docker 运行 json 文件):
aws elasticbeanstalk create-application-version \
--application-name $APP_NAME \
--version-label $VERSION \
--source-bundle S3Bucket=$S3_BUCKET,S3Key=$S3_PATH/$APP
那么……当“包”只是一个最终构建容器的 json 文件时,如何在源包的顶级目录中找到 .ebextensions 目录? (我的第一次尝试只是将它放在项目的根目录中,但没有成功。)
如果您使用 .json 文件进行 docker 部署,则不能使用 .ebextensions。
但是您可以创建一个包含您的 .json 和您的 .ebextension 目录的 zip,一切都应该有效。使用 zip 作为部署工件而不是原始 json.