AWS ElasticBeanstalk找不到Dockerfile

我有以下目录布局

./www/index.php Dockerfile apache-config.conf 

然后将文件压缩并上传到Elastic Beanstalk,但是我收到以下错误消息:

 [Instance: i-572d1ae8] Command failed on instance. Return code: 1 Output: Dockerfile and Dockerrun.aws.json are both missing, abort deployment. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03build.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. 

日志文件包含以下消息:

 AppDeployPreHook/01unzip.sh] : Completed activity. Result: Archive: /opt/elasticbeanstalk/deploy/appsource/source_bundle creating: /var/app/current/DI_Test/ inflating: /var/app/current/DI_Test/.DS_Store creating: /var/app/current/__MACOSX/ creating: /var/app/current/__MACOSX/DI_Test/ inflating: /var/app/current/__MACOSX/DI_Test/._.DS_Store inflating: /var/app/current/DI_Test/apache-config.conf inflating: /var/app/current/DI_Test/Dockerfile inflating: /var/app/current/__MACOSX/DI_Test/._Dockerfile creating: /var/app/current/DI_Test/www/ inflating: /var/app/current/DI_Test/www/.DS_Store creating: /var/app/current/__MACOSX/DI_Test/www/ inflating: /var/app/current/__MACOSX/DI_Test/www/._.DS_Store inflating: /var/app/current/DI_Test/www/index.php [2015-10-29T14:01:33.279Z] INFO [2865] - [Application deployment/StartupStage0/AppDeployPreHook/03build.sh] : Starting activity... [2015-10-29T14:01:33.579Z] INFO [2865] - [Application deployment/StartupStage0/AppDeployPreHook/03build.sh] : Activity execution failed, because: Dockerfile and Dockerrun.aws.json are both missing, abort deployment (ElasticBeanstalk::ExternalInvocationError) caused by: Dockerfile and Dockerrun.aws.json are both missing, abort deployment (Executor::NonZeroExitStatus) 

为什么我的dockerfile不能在这里被读取? 我可以在没有Elastic Beanstalk的情况下构build映像并运行它。

我也遇到过这个问题。 看来Dockerrun.aws.json文件也是必需的。 我相信这是因为其他文件包含在应用程序中。 如果你只有一个Dockerfile而没有别的东西,那就不需要了。

以下是文档: http : //docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_image.html

您不需要将父目录包含在zip文件中。 假设你想压缩./www/index.php,Dockerfile和apache-config.conf然后,

 zip dist.zip Dockerfile ./www/index.php apache-config.conf 

上传dist.zip。 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deployment.source.html