Support the ongoing development of Laravel.io →
Configuration Installation Laravel

I have updated my Laravel app from 6 to 7 and then 8 without problems. However, when I try to build an my docker image, it fails at the composer install --no-dev -o command. If I run the same command in my terminal, there is no error. The error is

In Request.php line 335:
                                                                               
  Argument 1 passed to Symfony\Component\HttpFoundation\Request::create() mus  
  t be of the type string, null given, called in /app/vendor/laravel/framewor  
  k/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32

and the command used to build the image is @docker build $(DOCKER_BUILD_ARG) -t $(IMAGE_TAG) -f $(DOCKERFILE) . It seems like it is a problem with a laravel framework file. I Googled this error but have not found any solution. I tried to run composer dump autoload, php artisan cache:clar and php artisan config:clear, none of these fixed my issue.

My dockerfile looks like this:

FROM armcanada/php7-mssql:latest

# Copy files
ADD . /app/
ADD php.ini /etc/php.ini
ADD arm-http.conf /etc/httpd/conf.modules.d/arm-http.conf

# Install app dependencies
RUN composer install --no-dev -o

# Fix permissions
RUN chmod -R 777 ./storage
RUN chmod -R 777 ./bootstrap/cache

# Cache route & views
RUN php artisan route:cache
RUN php artisan view:cache

CMD ["start_httpd"]

and my composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.3.0",
        "armcanada/laravel-honeypot": "dev-master",
        "bacon/bacon-qr-code": "^2.0",
        "barryvdh/laravel-dompdf": "^0.8.6",
        "box/spout": "^3.0.1",
        "doctrine/dbal": "^2.7",
        "erusev/parsedown": "^1.7",
        "fideloper/proxy": "~4.0",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "hackzilla/password-generator": "^1.5",
        "itsgoingd/clockwork": "^4.1",
        "laravel/framework": "^8.0",
        "laravel/helpers": "^1.3",
        "laravel/tinker": "^2.0",
        "laravel/ui": "^3.0",
        "maatwebsite/excel": "^3.1",
        "paragonie/constant_time_encoding": "^2.3",
        "predis/predis": "^1.1",
        "rickycezar/laravel-jwt-impersonate": "^1.3",
        "spatie/laravel-permission": "^3.18",
        "tymon/jwt-auth": "^1.0.0",
        "yajra/laravel-datatables": "^1.4"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.2",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "^9.0"
    },
    "autoload": {
        "psr-4": {
            "Mz\\": "app/",
            "Database\\Seeders\\": "database/seeders/"
        },
        "files": [
            "app/Support/Helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/armcanada/laravel-honeypot"
        }
    ],
    "extra": {
        "laravel": {
            "dont-discover": [
                "tymon/jwt-auth"
            ]
        }
    }
}


I have also tried to delete the vendor folder and the composer.lock, without success. What can I do?

Last updated 3 years ago.

zworthkey liked this thread

1

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.