使用CLI部署命令通过Dockerrun.aws.json部署到Elasticbeanstalk [英] Deploy to elasticbeanstalk via CLI deploy command with Dockerrun.aws.json

查看:143
本文介绍了使用CLI部署命令通过Dockerrun.aws.json部署到Elasticbeanstalk的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行具有多个环境的Elasticbeanstalk应用程序.这个特定的应用程序托管着托管Web服务的Docker容器.

I am running an elasticbeanstalk application, with multiple environments. This particular application is hosting docker containers which host a webservice.

要将应用程序的新版本上载并部署到其中一种环境,我可以浏览Web客户端并单击上传和部署",然后从文件选项中选择我最新的Dockerrun.aws.json文件,引用了私有容器的最新版本.上传和部署工作正常,没有问题.

To upload and deploy a new version of the application to one of the environments, I can go through the web client and click on "Upload and Deploy" and from the file option I select my latest Dockerrun.aws.json file, which references the latest version of the container that is privately hosted. The upload and deploy works fine and without issue.

为了让我自己和其他人更容易部署,我希望能够使用CLI上载和部署Dockerrun.aws.json文件.如果我在没有任何特殊配置的情况下使用cli eb deploy命令,则会发生压缩整个应用程序并将其发送到主机的正常过程,并且会失败(无法推断出它只需要读取Dockerrun.aws.json文件).

To make it simpler for myself and others to deploy I'd like to be able to use the CLI to upload and deploy the Dockerrun.aws.json file. If I use the cli eb deploy command without any special configuration the normal process of zipping up the whole application and sending it to the host occurs and fails (it cannot reason out that it only needs to read the Dockerrun.aws.json file).

我发现了一个有关使用.elasticbeanstalk/config.yml文件控制上传内容的文档花絮.

I found a documentation tidbit about controlling what is uploaded using the .elasticbeanstalk/config.yml file.

使用以下语法:

deploy: artifact: Dockerrun.aws.json

deploy: artifact: Dockerrun.aws.json

文件已上传,并且实际上已成功部署到第一批实例,然后始终无法部署到第二组实例.

The file is uploaded and actually deploys successfully to the first batch of instances, and then always fails to deploy to the second set of instances.

失败错误的味道是:容器意外退出..."

The failure error is of the flavor: 'container exited unexpectedly...'

任何人都可以解释或提供使用CLI部署单个Docker容器应用程序的规范方法的链接吗?

Can anyone explain, or provide link to the canonical approach for using the CLI to deploy single docker container applications?

推荐答案

因此,事实证明,我在config.yml中列出的方法是正确的.我看到部分成功的部署的原因是,EB并未阻止先前在主机上运行的docker容器.

So it turns out that the method I listed about with the config.yml was correct. The reason I was seeing a partially successful deployment was because the previously running docker container on the hosts was not being stopped by EB.

我认为正在发生的事情是EB正在发送类似的消息

I think that what was happening was that EB is sending something like

sudo docker kill --signal=SIGTERM $CONTAINER_ID而不是更常见的sudo docker stop $CONTAINER_ID

我正在运行的特定容器没有响应SIGTERM,因此只能放在那里.当我使用SIGKILL在本地对其进行测试时,它将(显然)正确停止,但是仅SIGTERM不能停止它.

The specific container I was running didn't respond to SIGTERM and so it would just sit there. When I tested it locally with SIGKILL it would (obviously) stop properly, but SIGTERM alone wouldn't stop it.

问题不是部署方法,而是EB产生的输出和我的误解中的混淆.

The issue wasn't the deployment methodology but rather confusion in the output that EB generated and my misinterpretation.

这篇关于使用CLI部署命令通过Dockerrun.aws.json部署到Elasticbeanstalk的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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