gpt4 book ai didi

amazon-web-services - 容器ECS EC2不是以 `running exec setns process for init caused\“exit status 23\”开头:“未知”

转载 作者:行者123 更新时间:2023-12-02 18:27:42 24 4
gpt4 key购买 nike

尝试在支持EC2的AWS ECS上运行hello-world容器时遇到以下错误:

CannotStartContainerError: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "process_linux.go:301: running exec setns process for init caused \"exit status 23\"": unknown

我的dockerfile看起来像:

FROM ubuntu:18.04

# Install dependencies
RUN apt-get update && \
apt-get -y install apache2

# Install apache and write hello world message
RUN echo 'Hello World!' > /var/www/html/index.html

# Configure apache
RUN echo '. /etc/apache2/envvars' > /root/run_apache.sh && \
echo 'mkdir -p /var/run/apache2' >> /root/run_apache.sh && \
echo 'mkdir -p /var/lock/apache2' >> /root/run_apache.sh && \
echo '/usr/sbin/apache2 -D FOREGROUND' >> /root/run_apache.sh && \
chmod 755 /root/run_apache.sh

EXPOSE 80

CMD /root/run_apache.sh

和我的任务定义:
{
"ipcMode": null,
"executionRoleArn": null,
"containerDefinitions": [
{
"dnsSearchDomains": null,
"logConfiguration": null,
"entryPoint": null,
"portMappings": [
{
"hostPort": 0,
"protocol": "tcp",
"containerPort": 80
}
],
"command": null,
"linuxParameters": null,
"cpu": 0,
"environment": [
{
"name": "ENVIRONMENT",
"value": "qa"
},
{
"name": "SOFTWARE_VERSION",
"value": "28"
}
],
"resourceRequirements": null,
"ulimits": null,
"dnsServers": null,
"mountPoints": [],
"workingDirectory": null,
"secrets": null,
"dockerSecurityOptions": null,
"memory": null,
"memoryReservation": null,
"volumesFrom": [],
"stopTimeout": null,
"image": "docker.foobar.com/hello-ecs:28",
"startTimeout": null,
"dependsOn": null,
"disableNetworking": null,
"interactive": null,
"healthCheck": null,
"essential": true,
"links": [],
"hostname": null,
"extraHosts": null,
"pseudoTerminal": null,
"user": null,
"readonlyRootFilesystem": null,
"dockerLabels": {
"owner": "shared-infrastructure",
"environment": "qa",
"awsCostCenter": "shared-infrastructure",
"software_version": "28"
},
"systemControls": null,
"privileged": null,
"name": "hello-ecs"
}
],
"placementConstraints": [],
"memory": "4",
"taskRoleArn": "arn:aws:iam::123456789:role/hello-ecs-qa-task-role",
"compatibilities": [
"EC2"
],
"taskDefinitionArn": "arn:aws:ecs:eu-west-1:123456789:task-definition/hello-ecs-qa:27",
"family": "hello-ecs-qa",
"requiresAttributes": [
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.task-iam-role"
},
{
"targetId": null,
"targetType": null,
"value": null,
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
}
],
"pidMode": null,
"requiresCompatibilities": [
"EC2"
],
"networkMode": "bridge",
"cpu": "128",
"revision": 27,
"status": "ACTIVE",
"inferenceAccelerators": null,
"proxyConfiguration": null,
"volumes": []
}

容器实例为:
Agent version  1.30.0
Docker version 18.06.1-ce

有什么想法可以解决或调试吗?谢谢

最佳答案

我从工作任务定义中进行了反向工作,罪魁祸首是"memory": "4",
将其更改为"memory": "256",使任务成功启动。

关于amazon-web-services - 容器ECS EC2不是以 `running exec setns process for init caused\“exit status 23\”开头:“未知”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57628732/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com