LoginSignup
10
4

More than 5 years have passed since last update.

Hydra用のdocker-compose.ymlでエラーが出た際の対処法

Last updated at Posted at 2018-04-11

つまづいたこと

※2017年に実験した結果の記事なので、若干古い情報である可能性があります

自作docker-compose.ymlの一部

version: '3'

services:
  hydra:
     image:
      - oryd/hydra:latest

社内の実験で自作のdocker-compose.ymlを作成して docker-compose up を押下すると、
以下のエラーが発生した。

ERROR: The Compose file './docker-compose.yml' is invalid because:
services.hydra.image contains an invalid type, it should be a string

it should be a string とあるので文字列にしなければならないというのはよくわかったが、
どうすればいいのか不明だった。

解決方法

以下のように修正した。

version: '3'

services:
  hydra:
    image: oryd/hydra:latest

そもそも、yamlの文法をきちんと学んでいなかったのが問題だった。
http://magazine.rubyist.net/?0009-YAML#l3
YAML では、行頭に「-」をつけることで配列を表現します

stringで指定しなければならないところを配列で指定していたようだ。

10
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
4