wodby / docker4php

Docker-based PHP stack
https://wodby.com/docker4php
MIT License
277 stars 44 forks source link

Invalid compose file #15

Closed Ercogx closed 3 years ago

Ercogx commented 3 years ago

When I try manage volumes mariadb manually. I get this error

ERROR: The Compose file './docker-compose.yml' is invalid because: services.mariadb.environment.volumes contains ["./mysql:/var/lib/mysql"], which is an invalid type, it should be a string, number, or a null

I also use docker4wordpress and I never see this error. Also I try use quotation marks in this stroke ./mysql:/var/lib/mysql but did not give any effect

Host OS

OS: Manjaro Linux x86_64 Kernel: 5.9.16-1-MANJARO

Docker info output

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-tp-docker)

Server:
 Containers: 7
  Running: 0
  Paused: 0
  Stopped: 7
 Images: 20
 Server Version: 20.10.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b.m
 runc version: 12644e614e25b05da6fd08a38ffa0cfe1903fdec
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.9.16-1-MANJARO
 Operating System: Manjaro Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.721GiB
 Name: vitalik-pc
 ID: NTA6:ZLZN:JQ5A:Z46R:RHUJ:LRVO:KJB4:6LTQ:7VRK:DRMR:OX23:3URB
 Docker Root Dir: /home/vitalik/.docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio weight support
WARNING: No blkio weight_device support

Docker compose file

services:
  mariadb:
    image: wodby/mariadb:$MARIADB_TAG
    container_name: "${PROJECT_NAME}_mariadb"
    stop_grace_period: 30s
    environment:
      MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
      MYSQL_DATABASE: $DB_NAME
      MYSQL_USER: $DB_USER
      MYSQL_PASSWORD: $DB_PASSWORD
      volumes:
  #    - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
      - ./mysql:/var/lib/mysql # I want to manage volumes manually.
csandanov commented 3 years ago

Thanks for reporting, there was an incorrect indentation for volumes, should have the same indentation as environment