Skip to content

Issue on Magento 2.4.6 installing on docker

Hi I have installed magento 2 on docker.when I stop and start the container ,it shows

error: failed switching to “root”: operation not permitted

After I run as root also the issue persist.docker.compose.yml file as follows

version: '3' services:
    web:
        image: webdevops/php-apache-dev:8.1
        container_name: web
        restart: always
        user: application
        environment:
          - WEB_ALIAS_DOMAIN=http://local.magento.com/
          - WEB_DOCUMENT_ROOT=/app/pub
          - PHP_DATE_TIMEZONE=EST
          - PHP_DISPLAY_ERRORS=1
          - PHP_MEMORY_LIMIT=2048M
          - PHP_MAX_EXECUTION_TIME=300
          - PHP_POST_MAX_SIZE=500M
          - PHP_UPLOAD_MAX_FILESIZE=1024M
        volumes:
          - /var/www/html/magento2:/app:cached
        ports:
          - "80:80"
          - "443:443"
          - "32823:22"
        links:
          - mysql
    mysql:
        image: mysql:8.0
        container_name: mysql
        restart: always
        ports:
          - "3306:3306"
        environment:
          - MYSQL_ROOT_PASSWORD=xxxx
          - MYSQL_DATABASE=xxxx
        volumes:
          - magento-db-data:/var/lib/mysql
    phpmyadmin:
        container_name: phpmyadmin
        restart: always
        image: phpmyadmin/phpmyadmin:latest
        environment:
          - MYSQL_ROOT_PASSWORD=xxxx
          - PMA_USER=xxxx
          - PMA_PASSWORD=xxxx
        ports:
          - "8080:80"
        links:
          - mysql:db
        depends_on:
          - mysql
    elasticsearch:
        container_name: elasticsearch
        image : docker.elastic.co/elasticsearch/elasticsearch:7.9.2-amd64
        environment:
          - node.name=elasticsearch
          - cluster.name=es-docker-cluster
          - discovery.type=single-node
          - bootstrap.memory_lock=true
          - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
        ulimits:
          memlock:
            soft: -1
            hard: -1
        volumes:
          - magento-es-data:/usr/share/elasticsearch/data
        ports:
          - 9200:9200
    redis:
      image: redis:6.2-alpine
      ports:
        - "6379:6379"
      volumes:
        - redis-data:/data volumes:
    magento-db-data:
        external: false
    magento-es-data:
        external: false
    redis-data:
         external: false