将Docker与AWS Elastic Beanstalk结合使用有什么优势? [英] What's the advantages of using Docker with AWS Elastic Beanstalk?

查看:105
本文介绍了将Docker与AWS Elastic Beanstalk结合使用有什么优势?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在AWS Elastic Beanstalk上部署了两个网站,然后听说了Docker,所以我想这次可以在小型企业电子商务网站(Lumen + Angularjs)上尝试一下。我在整个Internet上进行了搜索,但是由于没有Docker的经验,因此
仍然很难很好地了解在AWS上使用Docker的优势。我所能找到的是这样的一些描述:

I've deployed a couple of websites on AWS Elastic Beanstalk, and then I heard of Docker, so I think I can probably try it this time for a small business e-commerce website (Lumen + Angularjs). I searched all over the Internet, but as having no experience with the Docker, it is still hard to get a great understanding of the advantages of using Docker on AWS. All I can find are some descriptions like this:


Pros

Pros


  • 依赖性和服务器硬件的独立管理

  • 开发环境与内部生产环境相同(在内部)

  • 依赖性管理意味着并非每个人都需要对技术堆栈的每个部分都有深入的了解

  • 使用AWS开发工具包或第三方工具轻松自定义任务和服务调度

  • 善用ECS将可用资源分配给具有足够可用资源的EC2的可用资源,当任务需要更多资源时使用自动扩展

  • Separated management of dependencies and server hardware
  • Development environment is identical (internally) to production environment
  • Dependency management means that not everyone needs intimate knowledge about every part of your technology stack
  • Easy custom task and service scheduling with AWS SDK or a third-party tool
  • Make good use of available resources with ECS assigning tasks to EC2’s with enough free resources Use auto-scaling when tasks need more resources

缺点


  • 内部版本生成需要上传的大文件

  • Docker NAT会增加网络延迟(使用docker run – net = host,有关docker性能的更多信息,请参见此处)

  • 当docker是我这个词时,某些开发人员适合

  • 某些应用程序需要修复才能在Docker上工作

  • Build produces a large file that needs to be uploaded
  • Docker NAT can increase network latency (use docker run –net=host, for more docker performance info see here)
  • Some developers have fits when the word docker is mentioned
  • Some applications need to be fixed to work on Docker

有人可以给我一些简单的例子或解释吗?

Can someone give me some simple examples or explanations?

推荐答案

我认为Docker在Elastic Beanstalk上的主要优势是与在Elastic Beanstalk支持的特定运行时环境之一上运行应用程序相比,它具有灵活性。

I think the primary advantage of Docker on Elastic Beanstalk is the flexibility it gives you when compared to running your app on one of the specific runtime environments Elastic Beanstalk supports.

来自官方文档


Elastic Beanstalk支持从
Docker容器中部署Web应用程序。使用Docker容器,您可以定义自己的
运行时环境。您可以选择自己的平台,编程
语言以及其他平台不支持的任何应用程序依赖项(例如程序包管理器
或工具)。 Docker容器
是自包含的,包含Web应用程序运行所需的所有配置信息和
软件。

Elastic Beanstalk supports the deployment of web applications from Docker containers. With Docker containers, you can define your own runtime environment. You can choose your own platform, programming language, and any application dependencies (such as package managers or tools), that aren't supported by other platforms. Docker containers are self-contained and include all the configuration information and software your web application requires to run.



<例如,我已经看到很多人问如何在Elastic Beanstalk上部署使用Tomcat以外的东西的Java应用程序。在他们添加Docker支持之前,您无法做到这一点。

For example I've seen lots of people ask how to deploy Java applications that use something other than Tomcat on Elastic Beanstalk. You couldn't do that before they added Docker support.

如果您使用的是官方支持的Elastic Beanstalk运行时之一,那么我很难推荐使用Docker。它将您的应用程序与AWS特定细节区分开来,从理论上讲,您可以在AWS之外更轻松地运行您的应用程序。如果您想不惜一切代价避免供应商锁定,或者只想了解最新技术,那么Doc​​ker是一个不错的选择。否则,如果您已经在Elastic Beanstalk上运行了您的应用程序,则没有太多理由将其转换为Docker。

If you are using one of the officially supported Elastic Beanstalk runtimes then it is difficult for me to recommend using Docker. It would somewhat separate your app from AWS specifics, theoretically allowing you to run your app more easily outside of AWS. If you want to avoid vendor lock-in at all costs, or if you just want to stay up to date on the latest technologies, then Docker is a good choice. Otherwise, if you already have your app running on Elastic Beanstalk there isn't much reason for you to convert it to Docker.

编辑:请注意,正如您的问题标题所要求的那样,我的答复与专门用于Elastic Beanstalk的Docker有关。我在您的问题中看到,您还提到了ECS服务以及AWS上Docker的更一般用法。这是一个更大的讨论,在某些方面使用Docker代替普通的EC2实例肯定具有一些优势。

Note that my reply is related to using Docker specifically with Elastic Beanstalk, as your question title asks. I see in your question that you also refer to the ECS service and the more general use of Docker on AWS. That's a much bigger discussion and there are definitely some advantages to using Docker instead of plain EC2 instances for certain things.

编辑10/5/2019 :AWS似乎正在将人们推向Docker,这样他们就不必维护官方运行时的更新。例如,Elastic Beanstalk的最新Java运行时是Java8。因此,如果要在Elastic Beanstalk上运行现代版本的Java,则必须使用Docker。

Edit 10/5/2019: AWS seems to be pushing people towards Docker now so that they don't have to maintain updates to the official runtimes. For example the latest Java runtime for Elastic Beanstalk is Java 8. So if you want to run a modern version of Java on Elastic Beanstalk you would have to use Docker.

这篇关于将Docker与AWS Elastic Beanstalk结合使用有什么优势?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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