aws docker_使用Docker ECS插件将容器部署到AWS

aws docker

Containers are good, we love them. Amazon Elastic Container Service(ECS) is also good, and we like it, but the least likable aspects of ECS are deployments and creating necessary resources on AWS. Docker recently announced ECS integration through a new plugin that integrates Docker CLI and AWS seamlessly. For this tutorial, we are going to deploy WordPress installation using only Docker CLI with the help of the new ECS plugin.

容器是好的,我们喜欢它们。 Amazon Elastic Container Service(ECS)也很好,我们喜欢它,但是ECS最不讨人喜欢的方面是在AWS上的部署和创建必要的资源。 Docker最近宣布通过一个新插件进行ECS集成,该插件无缝集成了Docker CLI和AWS。 在本教程中,我们将借助新的ECS插件仅使用Docker CLI部署WordPress安装。

The new plugin is only available in Docker edge releases.https://www.docker.com/products/docker-desktop

新插件仅在Docker Edge版本中可用。 https://www.docker.com/products/docker-desktop

Let’s start by describing the Docker Compose template that we are going to use. We will be using the necessary Docker images from Bitnami.

让我们从描述将要使用的Docker Compose模板开始。 我们将使用来自Bitnami的必要Docker映像。

Now we can set the ECS plugin, before that, we have to agree on the new ARN format for ECS on AWS. ECS plugin depends on the new format, and if you didn’t agree with the new ARN changes, you won’t be able to install the plugin correctly.

现在我们可以设置ECS插件,在此之前,我们必须就AWS上ECS的新ARN格式达成一致。 ECS插件取决于新格式,如果您不同意新的ARN更改,则将无法正确安装插件。

https://console.aws.amazon.com/ecs/home?#/settings

https://console.aws.amazon.com/ecs/home?#/settings

Image for post

Next step, setting up the ECS plugin. I chose an existing AWS profile named admin here. You have to choose the same account that you agree on ARN changes.

下一步,设置ECS插件。 我在这里选择了一个名为admin的现有AWS配置文件。 您必须选择同意ARN更改的同一帐户。

Image for post

We need to switch to using the new context.

我们需要切换到使用新上下文。

Image for post

All good. We can start with the deployment.

都好。 我们可以从部署开始。

Image for post

Docker ECS plugin uses Cloudformation under the hood, we can check which resources are created by checking the Cloudformation console.

Docker ECS插件在后台使用Cloudformation,我们可以通过检查Cloudformation控制台来检查创建了哪些资源。

Image for post

We can get the running services via Docker CLI

我们可以通过Docker CLI获取正在运行的服务

Image for post

Logs are stored in Cloudwatch, we can get it either via Docker CLI command or through Cloudwatch console.

日志存储在Cloudwatch中,我们可以通过Docker CLI命令或通过Cloudwatch控制台获取日志。

Image for post

Head over to EC2 console and go to the Load Balancing section, there you should able to see the Load Balancer created by the ECS plugin.

转到EC2控制台并转到“负载平衡”部分,在那里您应该能够看到由ECS插件创建的负载均衡器。

Image for post

Copy the DNS name and try to visit the port 8080 where WordPress service is running.

复制DNS名称,并尝试访问运行WordPress服务的端口8080。

Image for post

Brilliant and all of these things are managed by Docker CLI, no need to install anything. You can also use images that are hosted in Docker Hub or the images hosted on Amazon Elastic Container Registry (ECR).

辉煌,所有这些都由Docker CLI管理,无需安装任何东西。 您还可以使用Docker Hub中托管的图像或Amazon Elastic Container Registry(ECR)中托管的图像。

After you are done with this tutorial, don’t forget to remove the resources.

学习完本教程之后,请不要忘记删除资源。

Image for post

Although this a beta feature for Docker CLI and it is still in the development process, we will keep an eye on future developments and update our readers as the project evolves.

尽管此功能是Docker CLI的测试版,并且仍在开发过程中,但我们将密切关注未来的发展,并随着项目的发展来更新读者。

翻译自: https://medium.com/tysonworks/deploy-containers-to-aws-using-docker-ecs-plugin-d071e07ec62a

aws docker

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值