在AWS上部署交互式Docker图像

发布于 2025-01-24 02:32:46 字数 194 浏览 0 评论 0 原文

我目前在AWS上部署我的Docker映像时面临问题。我设法将图像推入弹性容器注册表存储库中。我创建了一个具有任务的弹性容器服务群集。到目前为止,一切似乎都很好。

它并没有从我期望开始。我注意到必须使用“ -it”参数(Interactive shell)执行我的Docker映像。

您能告诉我如何启用这样的“ - ”参数?

谢谢!

I am currently facing issues with deploying my Docker image on AWS. I managed to push my image into a Elastic Container Registry repository. I created an Elastic Container Service Cluster with a Task. Everything seems fine so far.

It does not start as I expect. I noticed that locally my Docker image must be executed with the "-it" argument (interactive shell).

Can you tell me how to enable such "-it" parameter?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

上课铃就是安魂曲 2025-01-31 02:32:46

您可以将“ InitprocesseNabled”设置为容器定义中的真实参数。这将使我们能够

在DOC之后访问运行的容器可能会有所帮助:

一旦将此参数设置为TRUE您可以使用下面的Cli Cli命令将此参数设置为TRUE您,则可以将其设置为true运行容器。

aws ecs execute-command --cluster *cluster-name* \
--region *aws-region*
--task *task-id* \
--container *container-name* \
--interactive \
--command "/bin/sh"

https://docs.aws.aws.aws.aws.amazon.com/amazonecs/最新/developerguide/ecs-exec.html

you can set 'initProcessEnabled' to true parameter in container definition. This will allow us to access the running container

Following doc might help :

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_linuxparameters

Once this parameter is set to true you can access running container using below cli command.

aws ecs execute-command --cluster *cluster-name* \
--region *aws-region*
--task *task-id* \
--container *container-name* \
--interactive \
--command "/bin/sh"

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-exec.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文