docker-compose up した際に no declaration was found in the volumes section. というエラーが出てきたときの対処方法

結論(の一つ)

volumes の指定場所の記述方法において、カレントディレクトリにちゃんと ./ をつける。

だめな例

version: "3"
services:
  jellyfin:
    image: jellyfin/jellyfin
    network_mode: "host"
    volumes:
      - config:/config
      - cache:/cache
      - media:/media

良い例

version: "3"
services:
  jellyfin:
    image: jellyfin/jellyfin
    network_mode: "host"
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./media:/media

エラーメッセージ(詳細)

  • ERROR: Named volume "config:/config:rw" is used in service "jellyfin" but no declaration was found in the volumes section.
Powered by はてなブログ