0

錯誤:只能對重新配置的通用和多容器Docker平臺使用「eb local」。amazon elastic beanstalk eb在我的機器上出現問題本地運行

我想在亞馬遜上創建一個多容器docker容器web服務器。 我已經在亞馬遜上創建了一個重新配置的通用多容器環境。 我試圖運行此命令之前測試我Dockerrun.aws.json文件部署,但它不工作

我已經與亞馬遜的例子dockerrun測試,但沒有奏效

Dockerrun.aws.json

{ 
"AWSEBDockerrunVersion": 2, 
"volumes": [ 
    { 
     "name": "php-app", 
     "host": { 
      "sourcePath": "/var/app/current/php-app" 
     } 
    }, 
    { 
     "name": "nginx-proxy-conf", 
     "host": { 
      "sourcePath": "/var/app/current/proxy/conf.d" 
     } 
    } 
], 
"containerDefinitions": [ 
    { 
     "name": "php-app", 
     "image": "php:fpm", 
     "essential": true, 
     "memory": 128, 
     "mountPoints": [ 
      { 
       "sourceVolume": "php-app", 
       "containerPath": "/var/www/html", 
       "readOnly": true 
      } 
     ] 
    }, 
    { 
     "name": "nginx-proxy", 
     "image": "nginx", 
     "essential": true, 
     "memory": 128, 
     "portMappings": [ 
      { 
       "hostPort": 80, 
       "containerPort": 80 
      } 
     ], 
     "links": [ 
      "php-app" 
     ], 
     "mountPoints": [ 
      { 
       "sourceVolume": "php-app", 
       "containerPath": "/var/www/html", 
       "readOnly": true 
      }, 
      { 
       "sourceVolume": "awseb-logs-nginx-proxy", 
       "containerPath": "/var/log/nginx" 
      }, 
      { 
       "sourceVolume": "nginx-proxy-conf", 
       "containerPath": "/etc/nginx/conf.d", 
       "readOnly": true 
      } 
     ] 
    } 
] 
} 

回答

2

EB CLI阻止使用default_platform: Multi-container Docker 17.03.1-ce (Generic)存在一個錯誤。您可以在此處找到更多信息https://pypi.python.org/pypi/awsebcli/3.10.4 在繼續之前,請更新您的EB CLI。

更重要的是,如果您在AWS控制檯創建AWS豆莖應用(含瀏覽器),然後還挺eb init進口的,有一個在.elasticbeanstalk/config.yml的微小變化導致eb local run失敗,消息

ERROR: You can use "eb local" only with reconfigured, generic and multi container Docker platforms. 

例如,在我config.yml進口申請與AWS控制檯創建的,我有

default_platform: arn:aws:elasticbeanstalk:eu-west-1::platform/Multi-container Docker running on 64bit Amazon Linux/2.7.4 

只要改變它是

default_platform: Multi-container Docker 17.03.1-ce (Generic) 

你已經準備好了!

提示:如果是你不想更新您的EB CLI然後使用

default_platform: Multi-container Docker 1.11.2 (Generic) 
+0

它回答我的問題 – Marcelo

+0

如果你能回答這個問題對我來說太有原因的。 https://stackoverflow.com/questions/46165305/error-writing-dockerrun-aws-json-v2-file – Marcelo

+0

已經做到了。 :-) – mkubaczyk

相關問題