从ECS集群中运行AWS ECR的公共形象

发布于 2025-01-23 05:36:26 字数 366 浏览 0 评论 0原文

我已经成功地将我的3个Docker图像推向了ECR。 配置了ECS群集。 为存储在各自的ECR存储库中的3个图像创建了3个任务定义。 现在,我想在同一群集上与其他任务一起运行Redis的公共图像。我尝试使用以下URL创建一个任务定义: public.ecr.aws/ubuntu/ redis:最新

,但是一旦我作为新任务运行,我就会收到以下错误:

任务中的必需容器

在此错误中退出了任何具体原因,还是我做错了什么?

I have successfully pushed my 3 docker images on ECR.
Configured an ECS cluster.
Created 3 task definitions for those 3 images stored in respective ECR repositories.
Now, I want to run a public image of redis on the same cluster as a different task. I tried created a task definition of the same using the following URL: public.ecr.aws/ubuntu/redis:latest

But as soon as I run it as a new task I get the following error:

Essential container in task exited

Any specific reason for this error or am I doing something wrong?

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

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

发布评论

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

评论(1

指尖上的星空 2025-01-30 05:36:26

好的,因此Redis映像需要设置密码(我也建议您也要),或者允许它连接到REDIS群集而无需密码。

要配置密码或禁用密码验证,您需要在图像中设置环境变量。您可以读取文档

幸运的是,在EC中,这很容易。您需要指定。因此,要么:

{
    "family": "",
    "containerDefinitions": [
        {
            "name": "",
            "image": "",
            ...
            "environment": [
                {
                    "name": "ALLOW_EMPTY_PASSWORD",
                    "value": "yes"
                }
            ],
            ...
        }
    ],
    ...
}

要进行密码:

{
    "family": "",
    "containerDefinitions": [
        {
            "name": "",
            "image": "",
            ...
            "environment": [
                {
                    "name": "REDIS_PASSWORD",
                    "value": "your_password"
                }
            ],
            ...
        }
    ],
    ...
}

要进行更多的颗粒状配置,您应该阅读我上面发布的Redis Docker图像的文档。

Ok, so the redis image needs to either set a password (I recommend this as well) or allow it to connect to the redis cluster without a password.

To configure a password or disable passwords auth, you need to set environment variables in the image. You can read the documentation under the heading Configuration

Luckily, this is easy in ECS. You need to specify the environment variable in the task definition. So either:

{
    "family": "",
    "containerDefinitions": [
        {
            "name": "",
            "image": "",
            ...
            "environment": [
                {
                    "name": "ALLOW_EMPTY_PASSWORD",
                    "value": "yes"
                }
            ],
            ...
        }
    ],
    ...
}

or for a password:

{
    "family": "",
    "containerDefinitions": [
        {
            "name": "",
            "image": "",
            ...
            "environment": [
                {
                    "name": "REDIS_PASSWORD",
                    "value": "your_password"
                }
            ],
            ...
        }
    ],
    ...
}

For more granular configuration you should read the documentation of the redis docker image I posted above.

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