2016-08-02 5 views
3

これは私のサンプルのdocker-compose.ymlファイルです。私はdocker-compose up -dを使用する場合Docker Composeファイルが無効で、追加プロパティが許可されていません

version: '2' 
config-server: 
    image: ccc/config-server 
    restart: always 
registration-server: 
    image: ccc/registration-server 
    restart: always 
    ports: 
    - 1111:1111 

私はエラーを取得する:

"ERROR: The Compose file './docker-compose.yml' is invalid because: 
Additional properties are not allowed ('registration-server', 'config-server' were unexpected) 

You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1. 
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/ 

答えて

7

あなたはservicesキーワードが欠落している、あなたの正しい.ymlは次のとおりです。

version: '2' 
services: 
    config-server: 
    image: ccc/config-server 
    restart: always 
    registration-server: 
    image: ccc/registration-server 
    restart: always 
    ports: 
     - 1111:1111 
+0

もサービス 'S' でなければなりません小さい – N15

関連する問題