简体   繁体   English

CannotStartContainerError:ResourceInitializationError:创建新容器运行时任务失败:创建垫片失败:OCI 运行时创建失败:

[英]CannotStartContainerError: ResourceInitializationError: failed to create new container runtime task: failed to create shim: OCI runtime create failed:

Here's the full error message:这是完整的错误消息:

CannotStartContainerError: ResourceInitializationError: failed to create new container runtime task: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/": permission denied: unknown Entry point CannotStartContainerError:ResourceInitializationError:创建新容器运行时任务失败:创建垫片失败:OCI 运行时创建失败:container_linux.go:380:启动容器进程导致:exec:“/”:权限被拒绝:未知入口点

I have an application that I created a docker image with and had it working fine on lambda. The image is on ECR.我有一个应用程序,我用它创建了一个 docker 图像,并让它在 lambda 上正常工作。图像在 ECR 上。 I deleted my lambda function, created a docker container in ECS from that image and utilized Fargate.我删除了我的 lambda function,从该映像在 ECS 中创建了一个 docker 容器并使用了 Fargate。

here is my main.tf file in my ECS module on Terraform that I used to create this task.这是我用于创建此任务的 Terraform 上 ECS 模块中的 main.tf 文件。

    resource "aws_ecs_cluster" "cluster" {
  name = "python-cloud-cluster"

}

resource "aws_ecs_service" "ecs-service" {
  name            = "python-cloud-project"
  cluster         = aws_ecs_cluster.cluster.id
  task_definition = aws_ecs_task_definition.pcp-ecs-task-definition.arn
  launch_type     = "FARGATE"
  network_configuration {
    subnets         = var.service_subnets
    security_groups = var.pcp_service_sg
    assign_public_ip = true
  }
  desired_count = 1
}

resource "aws_ecs_task_definition" "pcp-ecs-task-definition" {
  family                   = "ecs-task-definition-pcp"
  network_mode             = "awsvpc"
  requires_compatibilities = ["FARGATE"]
  memory                   = "1024"
  cpu                      = "512"
  task_role_arn            = var.task_role_arn
  execution_role_arn       = var.task_role_arn
  container_definitions    = <<EOF
[
  {
    "name": "pcp-container",
    "image": "775362094965.dkr.ecr.us-west-2.amazonaws.com/weather-project:latest",
    "memory": 1024,
    "cpu": 512,
    "essential": true,
    "entryPoint": ["/"],
    "portMappings": [
      {
        "containerPort": 80,
        "hostPort": 80
      }
    ]
  }
]
EOF
}

I found a base template online and altered it to fit my needs.我在网上找到了一个基本模板并对其进行了修改以满足我的需要。 I just realized the entry point is set to ["/"] in the task definition, which was default from the template I used.我刚刚意识到任务定义中的入口点设置为 ["/"],这是我使用的模板的默认值。 What should I be setting it to?我应该将其设置为什么? Or this error caused by a different issue?或者这个错误是由其他问题引起的?

entryPoint is optional , and you don't have to specify it if you don't know what it is.entryPoint可选的,如果您不知道它是什么,则不必指定它。

In your case it is / which is incorrect.在您的情况下,它是/这是不正确的。 It should be some executable (eg /bin/bash ), and it depends on your container and what the container does.它应该是一些可执行文件(例如/bin/bash ),并且它取决于您的容器和容器的作用。 But again, its optional.但同样,它是可选的。

You have to check documentation of your weather-project container, and see what exactly it does and how to use it.你必须检查你的weather-project容器的文档,看看它到底做了什么以及如何使用它。

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

相关问题 KafkaTopicProvisioner - 创建主题失败 - KafkaTopicProvisioner - Failed to create topics BigQuery 中的 Bigtable“无法创建表:未找到” - Bigtable in BigQuery "Failed to create table: Not found" 通过云形成创建 SQS 策略失败 - SQS policy failed to create via cloud formation GCP - Cloud Composer 2 - 在此环境上创建操作失败 - GCP - Cloud Composer 2 - Create operation on this environment failed AWS EKS NodeGroup“创建失败”:实例未能加入 kubernetes 集群 - AWS EKS NodeGroup "Create failed": Instances failed to join the kubernetes cluster React Native:尝试创建新用户时出现 firebase auth/network-request-failed 错误,但在登录时却没有? - React Native: firebase auth/network-request-failed error when trying to create a new user, but not on login? 获取通道的背书客户端时出错:无法创建新连接:超出上下文截止日期 - Error getting endorser client for channel: failed to create new connection: context deadline exceeded 错误:创建 containerd 容器失败:无法加载 seccomp 配置文件,没有这样的文件或目录 - Error: failed to create containerd container: cannot load seccomp profile, no such file or directory AWS App Runner 在健康检查时“创建失败” - AWS App Runner "Create Failed" on health check 如何在备份失败时创建 Grafana 警报? - How to create Grafana alert for when backup failed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM