amazon-web-services - 在Amazon Container Service上定义任务时出错

标签 amazon-web-services docker aws-cli

但是要运行

aws ecs register-task-definition --family --container-definitions wordpress file: //wordpress.json"

在下面给出以下错误:
Error parsing parameter '--container-definitions': Invalid JSON: Expecting object: line 1 column 1 (char 0)

收到的JSON:{

我的wordpress.json:
{
  "containerDefinitions": [
    {
      "name": "wordpress",
      "links": [
        "mysql"
      ],
      "image": "wordpress",
      "essential": true,
      "portMappings": [
        {
          "containerPort": 80,
          "hostPort": 80
        }
      ],
      "memory": 500,
      "cpu": 10
    },
    {
      "environment": [
        {
          "name": "MYSQL_ROOT_PASSWORD",
          "value": "password"
        }
      ],
      "name": "mysql",
      "image": "mysql",
      "cpu": 10,
      "memory": 500,
      "essential": true
    }
  ],
  "family": "wordpress"
}

有什么建议么?

最佳答案

用于注册任务的正确的aws cli命令是
aws ecs register-task-definition --cli-input-json file://wordpress.json

关于amazon-web-services - 在Amazon Container Service上定义任务时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28793449/

相关文章:

php - 从PHP连接到MSSQL Server

amazon-web-services - 用于 EBS 快照的 AWS CLI

amazon-web-services - AWS CLI - 将完整输出保存为日志文件

amazon-web-services - 如何通过 id 获取最新的共享 AWS RDS 快照?

amazon-web-services - Elastic Beanstalk 上的基于时间的扩展

amazon-web-services - 如何在cloudformation模板中访问当前用户?

windows - 是否可以使用 AWS 运行普通的 Windows 10 机器?

api - 如何将特定的 AWS API Gateway 阶段连接到特定的 AWS lambda 别名

wordpress - 使用 docker-compose 和 nginx 在子目录中安装 wordpress

mysql - 如何使用 sql-alchemy 从 Flask 应用程序连接到 mysql docker 容器