简体   繁体   English

如何更新在 Amazon ECS 上运行的 docker 容器

[英]How to update docker container running on Amazon ECS

I'm very new to Amazon ECS, and I've written a task definition with 3 containers.我对 Amazon ECS 非常陌生,我编写了一个包含 3 个容器的任务定义。 One for my php application (main-server), second for node application (pubsub-server) and a redis container.一个用于我的 php 应用程序(主服务器),第二个用于节点应用程序(pubsub-server)和一个 redis 容器。

main-server and pubsub-server link to redis container. main-serverpubsub-server链接到redis容器。 (Is this the best way to arrange the containers?) (这是排列容器的最佳方式吗?)

The cluster runs well.集群运行良好。 However, I have an update to make in my main-server .但是,我要在main-server进行更新。 I am able to push the updated image to Amazon ECR but my changes don't reflect on the cluster.我能够将更新的映像推送到 Amazon ECR,但我的更改不会反映在集群上。 Is there any additional step to perform to run the updated container on push?是否有任何额外的步骤可以在推送时运行更新的容器?

I have tried deregistering the tasks and activating them back.我曾尝试取消注册任务并重新激活它们。 But it doesn't seem to work.但它似乎不起作用。

Please let me know if I need to provide anymore details.如果我需要提供更多详细信息,请告诉我。

You need to force a new deployment.您需要强制进行新部署。
From the AWS console, update the service definition and check the force new deployment checkbox on the first page, then skip to confirmation page.从 AWS 控制台更新服务定义并选中第一页上的强制新部署复选框,然后跳到确认页面。

From CLI:从命令行界面:

aws ecs update-service --cluster [cluster arn] --service [service arn] --force-new-deployment 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM