wodby / docker4drupal

Docker-based Drupal stack
https://wodby.com/docker4drupal
MIT License
1.24k stars 535 forks source link

Drush command falls to work Under container and globally #497

Open webapp-drupal opened 3 years ago

webapp-drupal commented 3 years ago

Codebase Built-in vanilla Drupal or mounted codebase recommended composer file base template

Describe your issue when trying to generate code via drush using the command make drush generate plugin- ... ect. I'm getting the drush worked but it not giving me to enter any options and falls in to error : output from terminal Welcome to plugin-views-argument-default generator! –––––––––––––––––––––––––––––––––––––––––––––––––––––

Module machine name: ➤ In Utils.php line 64:

The value is not correct machine name.

plugin-views-argument-default [-d|--directory [DIRECTORY]] [-a|--answers [ANSWERS]]

make: *** [docker.mk:78: drush] Error 1

Output of docker info

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

Server:
 Containers: 29
  Running: 7
  Paused: 0
  Stopped: 22
 Images: 24
 Server Version: 20.10.9
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: 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: 5b46e404f6b9f661a205e28d59c982d3634148f8
 runc version: v1.0.2-0-g52b36a2
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.11.0-37-generic
 Operating System: Ubuntu 20.04.3 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 7.47GiB
 Name: webapp
 ID: SPYE:JB2Z:KMYM:ADA6:7VD7:N3V7:TKCQ:WUQF:DO6A:GDZX:ZWJ4:C3VJ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Contents of your docker-compose.yml

version: "3.7"

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.
     - /media/vito/PROJECTS/MEEDHUB/api/database:/var/lib/mysql # Use bind mount

  php:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
#      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S opensmtpd:25
#      DB_HOST: $DB_HOST
#      DB_PORT: $DB_PORT
#      DB_USER: $DB_USER
#      DB_PASSWORD: $DB_PASSWORD
#      DB_NAME: $DB_NAME
#      DB_DRIVER: $DB_DRIVER
#      PHP_FPM_USER: wodby
#      PHP_FPM_GROUP: wodby
#      COLUMNS: 80 # Set 80 columns for docker exec -it.
#      # Read instructions at https://wodby.com/docs/stacks/php/local/#xdebug
#      PHP_XDEBUG: 1
#      PHP_XDEBUG_MODE: debug
#      PHP_IDE_CONFIG: serverName=my-ide
#      PHP_XDEBUG_IDEKEY: "my-ide"
#      PHP_XDEBUG_CLIENT_HOST: 172.17.0.1 # Linux
#      PHP_XDEBUG_CLIENT_HOST: host.docker.internal # Docker 18.03+ Mac/Win
#      PHP_XDEBUG_CLIENT_HOST: 10.0.75.1 # Windows, Docker < 18.03
#      PHP_XDEBUG_LOG: /tmp/php-xdebug.log
#      # PHPUnit Drupal testing configurations
#      SIMPLETEST_BASE_URL: "http://nginx"
#      SIMPLETEST_DB: "${DB_DRIVER}://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}#tests_"
#      MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-gpu","--headless"]}}, "http://chrome:9515"]'
    volumes:
    - ./:/var/www/html:cached
## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac
#    - mutagen:/var/www/html
## For XHProf and Xdebug profiler traces
#    - files:/mnt/files

  crond:
    image: wodby/drupal-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_crond"
    environment:
      CRONTAB: "0 * * * * drush -r /var/www/html/web cron"
    command: sudo -E LD_PRELOAD=/usr/lib/preloadable_libiconv.so crond -f -d 0
    volumes:
    - ./:/var/www/html:cached

  nginx:
    image: wodby/nginx:$NGINX_TAG
    container_name: "${PROJECT_NAME}_nginx"
    depends_on:
    - php
    environment:
      NGINX_STATIC_OPEN_FILE_CACHE: "off"
      NGINX_ERROR_LOG_LEVEL: debug
      NGINX_BACKEND_HOST: php
      NGINX_SERVER_ROOT: /var/www/html/web
      NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET
    #      NGINX_DRUPAL_FILE_PROXY_URL: http://example.com
    volumes:
    - ./:/var/www/html:cached
## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac
#    - mutagen:/var/www/html

    labels:
    - "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)"

  mailhog:
    image: mailhog/mailhog
    container_name: "${PROJECT_NAME}_mailhog"
    labels:
    - "traefik.http.services.${PROJECT_NAME}_mailhog.loadbalancer.server.port=8025"
    - "traefik.http.routers.${PROJECT_NAME}_mailhog.rule=Host(`mailhog.${PROJECT_BASE_URL}`)"

#  postgres:
#    image: wodby/postgres:$POSTGRES_TAG
#    container_name: "${PROJECT_NAME}_postgres"
#    stop_grace_period: 30s
#    environment:
#      POSTGRES_PASSWORD: $DB_PASSWORD
#      POSTGRES_DB: $DB_NAME
#      POSTGRES_USER: $DB_USER
#    volumes:
#    - ./postgres-init:/docker-entrypoint-initdb.d # Place init file(s) here.
#    - /path/to/postgres/data/on/host:/var/lib/postgresql/data # Use bind mount

#  apache:
#    image: wodby/apache:$APACHE_TAG
#    container_name: "${PROJECT_NAME}_apache"
#    depends_on:
#    - php
#    environment:
#      APACHE_LOG_LEVEL: debug
#      APACHE_BACKEND_HOST: php
#      APACHE_VHOST_PRESET: php
#      APACHE_DOCUMENT_ROOT: /var/www/html/web
#    volumes:
#    - ./:/var/www/html:cached
## Alternative for macOS users: Mutagen https://wodby.com/docs/stacks/drupal/local#docker-for-mac
#    - mutagen:/var/www/html

#    labels:
#    - "traefik.http.routers.${PROJECT_NAME}_apache.rule=Host(`${PROJECT_BASE_URL}`)"

#  varnish:
#    image: wodby/varnish:$VARNISH_TAG
#    container_name: "${PROJECT_NAME}_varnish"
#    depends_on:
#    - nginx
#    environment:
#      VARNISH_SECRET: secret
#      VARNISH_BACKEND_HOST: nginx
#      VARNISH_BACKEND_PORT: 80
#      VARNISH_CONFIG_PRESET: drupal
#      VARNISH_ALLOW_UNRESTRICTED_PURGE: 1
#    labels:
#    - "traefik.http.services.${PROJECT_NAME}_varnish.loadbalancer.server.port=6081"
#    - "traefik.http.routers.${PROJECT_NAME}_varnish.rule=Host(`varnish.${PROJECT_BASE_URL}`)"

#  redis:
#    container_name: "${PROJECT_NAME}_redis"
#    image: wodby/redis:$REDIS_TAG

#  adminer:
#    container_name: "${PROJECT_NAME}_adminer"
#    image: wodby/adminer:$ADMINER_TAG
#    environment:
#      # For PostgreSQL:
#      #      ADMINER_DEFAULT_DB_DRIVER: pgsql
#      ADMINER_DEFAULT_DB_HOST: $DB_HOST
#      ADMINER_DEFAULT_DB_NAME: $DB_NAME
#    labels:
#    - "traefik.http.routers.${PROJECT_NAME}_adminer.rule=Host(`adminer.${PROJECT_BASE_URL}`)"

  pma:
    image: phpmyadmin/phpmyadmin
    container_name: "${PROJECT_NAME}_pma"
    environment:
      PMA_HOST: $DB_HOST
      PMA_USER: $DB_USER
      PMA_PASSWORD: $DB_PASSWORD
      UPLOAD_LIMIT: 1G
    labels:
    - "traefik.http.routers.${PROJECT_NAME}_pma.rule=Host(`pma.${PROJECT_BASE_URL}`)"

  #  solr:
#    image: wodby/solr:$SOLR_TAG
#    container_name: "${PROJECT_NAME}_solr"
#    environment:
#      SOLR_DEFAULT_CONFIG_SET: $SOLR_CONFIG_SET
#      SOLR_HEAP: 1024m
#    labels:
#    - "traefik.http.services.${PROJECT_NAME}_solr.loadbalancer.server.port=8983"
#    - "traefik.http.routers.${PROJECT_NAME}_solr.rule=Host(`solr.${PROJECT_BASE_URL}`)"

#  drupal-node:
#    image: wodby/drupal-node:$DRUPAL_NODE_TAG
#    container_name: "${PROJECT_NAME}_drupal_nodejs"
#    labels:
#    - "traefik.http.routers.${PROJECT_NAME}_drupal_node.rule=Host(`drupal_node.${PROJECT_BASE_URL}`)"
#    environment:
#      NODE_SERVICE_KEY: node-service-key

#  memcached:
#    container_name: "${PROJECT_NAME}_memcached"
#    image: wodby/memcached:$MEMCACHED_TAG

#  rsyslog:
#    container_name: "${PROJECT_NAME}_rsyslog"
#    image: wodby/rsyslog:$RSYSLOG_TAG

#  athenapdf:
#    image: arachnysdocker/athenapdf-service:$ATHENAPDF_TAG
#    container_name: "${PROJECT_NAME}_athenapdf"
#    environment:
#      WEAVER_AUTH_KEY: weaver-auth-key
#      WEAVER_ATHENA_CMD: "athenapdf -S"
#      WEAVER_MAX_WORKERS: 10
#      WEAVER_MAX_CONVERSION_QUEUE: 50
#      WEAVER_WORKER_TIMEOUT: 90
#      WEAVER_CONVERSION_FALLBACK: "false"

#  node:
#    image: wodby/node:$NODE_TAG
#    container_name: "${PROJECT_NAME}_node"
#    working_dir: /var/www/html/path/to/theme/to/build
#    labels:
#    - "traefik.http.services.${PROJECT_NAME}_node.loadbalancer.server.port=3000"
#    - "traefik.http.routers.${PROJECT_NAME}_node.rule=Host(`node.${PROJECT_BASE_URL}`)"
#    expose:
#    - "3000"
#    volumes:
#    - ./:/var/www/html
#    command: sh -c 'yarn install && yarn run start'

#  blackfire:
#    image: blackfire/blackfire
#    container_name: "${PROJECT_NAME}_blackfire"
#    environment:
#      BLACKFIRE_SERVER_ID: XXXXX
#      BLACKFIRE_SERVER_TOKEN: YYYYY

#  webgrind:
#    image: wodby/webgrind:$WEBGRIND_TAG
#    container_name: "${PROJECT_NAME}_webgrind"
#    environment:
#      WEBGRIND_PROFILER_DIR: /mnt/files/xdebug
#    labels:
#    - "traefik.http.routers.${PROJECT_NAME}_webgrind.rule=Host(`webgrind.${PROJECT_BASE_URL}`)"
#    volumes:
#    - files:/mnt/files

#  elasticsearch:
#    image: wodby/elasticsearch:$ELASTICSEARCH_TAG
#    container_name: "${PROJECT_NAME}_elasticsearch"
#    environment:
#      ES_JAVA_OPTS: "-Xms500m -Xmx500m"
#    ulimits:
#      memlock:
#        soft: -1
#        hard: -1

#  kibana:
#    image: wodby/kibana:$KIBANA_TAG
#    container_name: "${PROJECT_NAME}_kibana"
#    depends_on:
#    - elasticsearch
#    labels:
#    - "traefik.http.services.${PROJECT_NAME}_kibana.loadbalancer.server.port=5601"
#    - "traefik.http.routers.${PROJECT_NAME}_kibana.rule=Host(`kibana.${PROJECT_BASE_URL}`)"

#  opensmtpd:
#    container_name: "${PROJECT_NAME}_opensmtpd"
#    image: wodby/opensmtpd:$OPENSMTPD_TAG

#  xhprof:
#    image: wodby/xhprof:$XHPROF_TAG
#    container_name: "${PROJECT_NAME}_xhprof"
#    restart: always
#    volumes:
#    - files:/mnt/files
#    labels:
#    - "traefik.http.routers.${PROJECT_NAME}_xhprof.rule=Host(`xhprof.${PROJECT_BASE_URL}`)"

#  chrome:
#    image: selenium/standalone-chrome:$SELENIUM_CHROME_TAG
#    container_name: "${PROJECT_NAME}_chrome"
#    volumes:
#    - /dev/shm:/dev/shm
#    entrypoint:
#    - chromedriver
#    - "--no-sandbox"
#    - "--disable-dev-shm-usage"
#    - "--log-path=/tmp/chromedriver.log"
#    - "--verbose"
#    - "--whitelisted-ips="

  traefik:
    image: traefik:v2.0
    container_name: "${PROJECT_NAME}_traefik"
    command: --api.insecure=true --providers.docker
    ports:
    - '8000:80'
#    - '8080:8080' # Dashboard
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

#  mutagen:
#    build:
#      context: .
#      dockerfile: mutagen/Dockerfile
#    init: true
#    container_name: "mutagen"
#    volumes:
#    - mutagen:/var/www/html

#volumes:
## For macOS users (Mutagen)
#  mutagen:
## For Xdebug profiler
#  files:

Contents of your .env

### Documentation available at https://wodby.com/docs/stacks/drupal/local
### Changelog can be found at https://github.com/wodby/docker4drupal/releases
### Images tags format explained at https://github.com/wodby/docker4drupal#images-tags

### PROJECT SETTINGS

PROJECT_NAME=drupal
PROJECT_BASE_URL=drupal

DB_NAME=drupal
DB_USER=drupal
DB_PASSWORD=drupal
DB_ROOT_PASSWORD=password
DB_HOST=mariadb
DB_PORT=3306
DB_DRIVER=mysql

### --- MARIADB ----

MARIADB_TAG=10.5-3.13.20
#MARIADB_TAG=10.4-3.13.20
#MARIADB_TAG=10.3-3.13.20
#MARIADB_TAG=10.2-3.13.20

### --- VANILLA DRUPAL ----

DRUPAL_TAG=9-4.35.0
#DRUPAL_TAG=8-4.35.0
#DRUPAL_TAG=7-4.35.0

### --- PHP ----

# Linux (uid 1000 gid 1000)

PHP_TAG=7.4-dev-4.28.0
#PHP_TAG=8.0-dev-4.28.0
#PHP_TAG=7.3-dev-4.28.0

# macOS (uid 501 gid 20)

#PHP_TAG=8.0-dev-macos-4.28.0
#PHP_TAG=7.4-dev-macos-4.28.0
#PHP_TAG=7.3-dev-macos-4.28.0

### --- NGINX ----

NGINX_TAG=1.21-5.16.0
#NGINX_TAG=1.20-5.16.0
#NGINX_TAG=1.19-5.16.0

NGINX_VHOST_PRESET=drupal9
#NGINX_VHOST_PRESET=drupal8
#NGINX_VHOST_PRESET=drupal7

### --- SOLR ---

SOLR_CONFIG_SET="search_api_solr_4.1.6"
#SOLR_CONFIG_SET="search_api_solr_4.0.1"
#SOLR_CONFIG_SET="search_api_solr_8.x-3.9"
#SOLR_CONFIG_SET="search_api_solr_8.x-3.2"
#SOLR_CONFIG_SET="search_api_solr_8.x-2.7"
#SOLR_CONFIG_SET="search_api_solr_8.x-1.2"
#SOLR_CONFIG_SET="search_api_solr_7.x-1.14"

SOLR_TAG=8-4.12.1
#SOLR_TAG=7-4.12.1
#SOLR_TAG=6-4.12.1
#SOLR_TAG=5-4.12.1

### --- ELASTICSEARCH ---

ELASTICSEARCH_TAG=7-5.13.10
#ELASTICSEARCH_TAG=6-5.13.10

### --- KIBANA ---

KIBANA_TAG=7-5.13.10
#KIBANA_TAG=6-5.13.10

### --- REDIS ---

REDIS_TAG=6-3.9.4
#REDIS_TAG=5-3.9.4

### --- NODE ---

NODE_TAG=16-dev-0.84.0
#NODE_TAG=14-dev-0.84.0
#NODE_TAG=12-dev-0.84.0

### --- VARNISH ---

VARNISH_TAG=6.0-4.7.6
#VARNISH_TAG=4.1-4.7.6

### --- POSTGRESQL ----

POSTGRES_TAG=13-1.23.2
#POSTGRES_TAG=12-1.23.2
#POSTGRES_TAG=11-1.23.2
#POSTGRES_TAG=10-1.23.2
#POSTGRES_TAG=9.6-1.23.2

### OTHERS

ADMINER_TAG=4-3.15.1
APACHE_TAG=2.4-4.6.1
ATHENAPDF_TAG=2.16.0
DRUPAL_NODE_TAG=1.0-2.0.0
MEMCACHED_TAG=1-2.9.3
OPENSMTPD_TAG=6.0-1.10.3
RSYSLOG_TAG=latest
SELENIUM_CHROME_TAG=3.141
WEBGRIND_TAG=1-1.22.0
XHPROF_TAG=3.0.5

Logs output docker-compose logs

Paste here
csandanov commented 3 years ago

It looks like you're trying to use interactive drush command via make drush action, it won't work, you just need to sh into a php container (via make shell) and proceed there with your drush command directly. Make action for drush is just a simple alias for non-interactive drush commands without need to sh into a container.