2016-06-22 10 views
3

Docker Composeでエラーが発生しました。助けてくださいDockerで無効なタイプエラーが発生しました。

ERROR: The Compose file '.\docker-compose.yml' is invalid because: 
services.lbapi.ports contains an invalid type, it should be an array 
services.lbweb.ports contains an invalid type, it should be an array 
services.lbapi.links contains an invalid type, it should be an array 
services.lbweb.links contains an invalid type, it should be an array 

docker-compose upを実行しているとき、コンファイルは

version: '2' 

services: 
    api: 
    build: 
     context: . 
     dockerfile: webapi/dockerfile 
    ports: 
     - 210 
    web: 
    build: 
     context: . 
     dockerfile: app/dockerfile 
    ports: 
     - 80 
    lbapi: 
    image: dockercloud/haproxy 
    links: 
     – api 
    ports: 
     – 8080:210 
    lbweb: 
    image: dockercloud/haproxy 
    links: 
     – web 
    ports: 
     – 80:80 

エラーです。 1.8.1

  • CPythonのバージョン:2.7.11
  • のOpenSSLのバージョン:

    • ドッキングウィンドウ・コンバージョン1.8.0-RC1、9bf6bc6
    • ドッカ-pyのバージョン構築OpenSSLを1.0.2d 7月9日2015
  • 答えて

    5

    あなたがしようとしました:

    version: '2' 
    
    services: 
        api: 
        build: 
         context: . 
         dockerfile: webapi/dockerfile 
        ports: 
         - 210 
        web: 
        build: 
         context: . 
         dockerfile: app/dockerfile 
        ports: 
         - 80 
        lbapi: 
        image: dockercloud/haproxy 
        links: 
         – api 
        ports: 
         – "8080:210" 
        lbweb: 
        image: dockercloud/haproxy 
        links: 
         – web 
        ports: 
         – "80:80" 
    
    1

    あなたは、ポートのウィットをカバーする必要がありますh括弧はドッカーが "ポート"配列で文字列または数字を期待しているが、8080:210は数字ではないため作成します。 https://docs.docker.com/compose/compose-file/#ports

    関連する問題