[英]How to get SYS_PTRACE on AWS Elastic Beanstalk with Amazon Linux 2, single-container, no Docker Compose
I need to do get the SYS_PTRACE kernel capability on my docker container.我需要在我的 docker 容器上获得 SYS_PTRACE kernel 功能。 Here's the Docerrun.aws.json:
这是 Docerrun.aws.json:
{
"AWSEBDockerrunVersion": "1",
"Authentication": {
"Bucket": "some-bucket",
"Key": "somekey"
},
"Image": {
"Name": "somename",
"Update": "true"
},
"Ports":[
{
"HostPort": 80,
"ContainerPort": 80
},
a few more ports
]
}
Remember, this is Amazon Linux 2, which is a whole new distribution and EB platform.请记住,这是 Amazon Linux 2,它是一个全新的分发和 EB 平台。 We're not using Docker Compose (wherein you could add that to the yml).
我们没有使用 Docker Compose(您可以将其添加到 yml)。
I tried just adding in the following section:我尝试在以下部分中添加:
"linuxParameters": {
"capabilities": {
"add": ["SYS_PTRACE"]
}
}
It was simply ignored.它被简单地忽略了。
Thanks!谢谢!
It seems to me, this setting is not supported in v1 .在我看来, v1 不支持此设置。 When looking into the docs under section " Docker platform Configuration - without Docker Compose " [1], linuxParameters is not listed as part of "Valid keys and values for the Dockerrun.aws.json v1 file".
在查看“ Docker 平台配置 - 没有 Docker Compose ”[1] 部分下的文档时, linuxParameters未列为“Dockerrun.aws.Z466DEEC76ECDF35FCA6D381571 文件的有效键和值”的一部分。 You might have to switch to v2 by using multi container Docker.
您可能必须使用多容器 Docker 切换到 v2。 The docs for v2 state that "the container definition and volumes sections of Dockerrun.aws.json use the same formatting as the corresponding sections of an Amazon ECS task definition file".
v2 state 的文档“Dockerrun.aws.json 的容器定义和卷部分使用与 Amazon ECS 任务定义文件的相应部分相同的格式”。 [2]
[2]
It looks like your code above would work in v2 because it is a valid task definition section, see [3].看起来您上面的代码可以在 v2 中运行,因为它是一个有效的任务定义部分,请参阅 [3]。
[1] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/single-container-docker-configuration.html [1] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/single-container-docker-configuration.html
[2] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html [2] https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html
[3] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html [3] https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.