open:docker-compose

docker-compose

version: "3"
 
services:
  db:
    image: mysql:latest
    platform: linux/x86_64
    container_name: my-mysql
    restart: always
    ports:
      - 3306:3306
    environment:
      TZ: Asia/Seoul
      MYSQL_DATABASE: my-database
      MYSQL_ROOT_PASSWORD: password
    command:
      # 명령어 실행
      - --character-set-server=utf8mb4
      - --collation-server=utf8mb4_unicode_ci
    volumes:
      - ./db/data:/var/lib/mysql
      - ./db/init:/docker-entrypoint-initdb.d

CREATE DATABASE IF NOT EXISTS `my_database`;

snippet.shell
root@server:~/docker# docker-compose up
ERROR: yaml.scanner.ScannerError: while scanning for the next token
found character '\t' that cannot start any token
  in "./docker-compose.yml", line 3, column 1

탭을 사용하면 에러, 스페이스로 변경함


  • open/docker-compose.txt
  • 마지막으로 수정됨: 2022/06/08 07:41
  • 저자 127.0.0.1