0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【docker-compose.yml】All mapping items must start at the same columnと出たとき

Posted at

docker-compose.ymlを編集していたら、以下のエラーが表示されました。

All mapping items must start at the same column

解決策:
同じアイテムのインデントを揃える。

以下は例ですが、例えばservicesであるphp:mysql:のインデントは半角2つで揃えています。
これがズレていると上記のエラーが出ました。

version: "3.9"

services:
  php:
    build: .
    volumes:
      - ./src:/var/www/html
    ports:
      - "8000:8000"
  mysql:
    platform: linux/x86_64
    image: mysql:5.7
    ports:
      - "3306:3306"
    volumes:
      - ./db:/var/lib/mysql7
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: laravel
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?