amazon-web-services - 连接到 AWS ECS 集群中正在运行的容器

标签 amazon-web-services docker amazon-ecs

我的团队继承了一个 AWS ECS 集群,上面运行着多个链接的容器,但没有源代码(是的,我知道......)。我们需要连接到其中一个正在运行的容器并在其中执行一些命令。这是我们的尝试:

我们还能如何连接到在 AWS ECS 上运行的容器?

更新:

我尝试按照示例使用 AWS CLI 访问容器 here ,才发现任务中没有启用execute命令:

An error occurred (InvalidParameterException) when calling the ExecuteCommand operation: The execute command failed because execute command was not enabled when the task was run or the execute command agent isn’t running. Wait and try again or run a new task with execute command enabled and try again.

现在是放弃的好时机吗?

最佳答案

如果创建任务时未启用 exec 命令,并且它在 Fargate 而不是 EC2 中运行,则无法像您尝试的那样连接到它。

ECR 中有 docker 镜像吗?您应该能够检查 ECS 任务定义以查看 Docker 镜像的位置,然后将 Docker 镜像下载到 EC2 服务器或您的本地计算机,此时您应该能够获取这些 Docker 镜像的内容。

关于amazon-web-services - 连接到 AWS ECS 集群中正在运行的容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68102088/

相关文章:

amazon-web-services - terraform 强制销毁/ad ASG,而不是依赖项更改进行更改

docker - 带有 Docker 的 mediasoup v3

docker - 如何增加docker build的卷大小

amazon-web-services - 推送新镜像版本后如何更新EC2实例

docker - 我应该如何在 ECS 上设置 Traefik?

amazon-web-services - DOWNLOAD_SOURCE 失败的 AWS CodeBuild

amazon-web-services - 如何提供cloudformation参数文件而不是在ansible playbook中列出参数?

python - 编写自定义过滤器的更好方法 | Python-AWS-Boto3

python - 本地运行 python 脚本与在 docker 中运行之间的区别

amazon-web-services - 如何获取与特定服务关联的任务ID