简体   繁体   English

如何使用 Amazon Linux 2、单容器、无 Docker 在 AWS Elastic Beanstalk 上获取 SYS_PTRACE

[英]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.

相关问题 如何使用 Amazon linux 2 在 Elastic beanstalk 中使用多容器 docker? - How to use multi container docker in Elastic beanstalk using Amazon linux 2? Docker 将依赖传递给 AWS Elastic Beanstalk - Docker compose depedency pass to AWS Elastic Beanstalk 带有 Amazon ECR Docker 映像的 AWS Elastic Beanstalk - AWS Elastic Beanstalk with Amazon ECR Docker image AWS Elastic Beanstalk Amazon Linux 2 - 如何设置自定义 NodeCommand - AWS Elastic Beanstalk Amazon Linux 2 - How to set a custom NodeCommand AWS Elastic Beanstalk Docker 容器端口映射 - AWS Elastic Beanstalk Docker container port mapping 如何在 AWS Elastic Beanstalk Docker 容器中记录 PHP 错误 - How to log PHP errors in an AWS Elastic Beanstalk Docker container AWS Elastic Beanstalk - 多容器 Docker - AWS Elastic Beanstalk - Multi Container Docker Elastic Beanstalk 与 Docker 在 64 位 Amazon Linux 2/3.2.2 和 Dockerrun.aws.json v3 上运行 - Elastic Beanstalk with Docker running on 64bit Amazon Linux 2/3.2.2 and Dockerrun.aws.json v3 我应该使用 AWS Elastic Beanstalk 还是 Amazon EC2 Container Service (ECS) 来扩展 Docker 容器? - Should I use AWS Elastic Beanstalk or the Amazon EC2 Container Service (ECS) to scale Docker containers? Amazon Elastic Beanstalk中的错误Docker部署-Docker容器意外退出 - Error Docker deployment in Amazon Elastic Beanstalk - Docker container quit unexpectedly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM