'Codeigniter 4 docker container giving Call to undefined function CodeIgniter\Autoloader\get_filenames()

I have setup codeigniter 4 in a docker container but when I run php spark serve. I get the following error

Call to undefined function CodeIgniter\Autoloader\get_filenames()

at SYSTEMPATH/Autoloader/FileLocator.php:310

Backtrace:
  1    SYSTEMPATH/CLI/Commands.php:88
       CodeIgniter\Autoloader\FileLocator()->listFiles('Commands/')

  2    SYSTEMPATH/CLI/Commands.php:46
       CodeIgniter\CLI\Commands()->discoverCommands()

  3    SYSTEMPATH/Config/Services.php:153
       CodeIgniter\CLI\Commands()->__construct()

  4    SYSTEMPATH/Config/BaseService.php:248
       CodeIgniter\Config\Services::commands(false)

  5    SYSTEMPATH/Config/BaseService.php:189
       CodeIgniter\Config\BaseService::__callStatic('commands', [...])

  6    SYSTEMPATH/Config/Services.php:150
       CodeIgniter\Config\BaseService::getSharedInstance('commands')

  7    SYSTEMPATH/Config/BaseService.php:248
       CodeIgniter\Config\Services::commands()

  8    SYSTEMPATH/CLI/CommandRunner.php:35
       CodeIgniter\Config\BaseService::__callStatic('commands', [])

  9    SYSTEMPATH/CodeIgniter.php:802
       CodeIgniter\CLI\CommandRunner()->__construct()

 10    SYSTEMPATH/CodeIgniter.php:403
       CodeIgniter\CodeIgniter()->createController()

 11    SYSTEMPATH/CodeIgniter.php:320
       CodeIgniter\CodeIgniter()->handleRequest(null, Object(Config\Cache), false)

 12    SYSTEMPATH/CLI/Console.php:48
       CodeIgniter\CodeIgniter()->run()

 13    ROOTPATH/spark:63
       CodeIgniter\CLI\Console()->run()

Here is my docker file:

FROM php:7.3-apache
RUN apt-get update && \
    apt-get install -y
RUN apt-get install -y curl
RUN apt-get install -y build-essential libssl-dev zlib1g-dev libpng-dev libjpeg-dev libfreetype6-dev
RUN apt-get install -y libicu-dev
COPY docker/apache/000-default.conf /etc/apache2/sites-enabled/000-default.conf
RUN apt-get update
RUN docker-php-ext-install intl
RUN docker-php-ext-configure intl
RUN a2enmod rewrite
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
    && docker-php-ext-install gd
COPY ./ /var/www/html/
RUN service apache2 restart

Any clues why this is happening? It appears that it might be some sort of path issue but I can't figure it out



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source