John Drex Astrande
John Drex Astrande

Reputation: 21

Docker - Laravel Artisan

I use this repo https://github.com/aschmelyun/docker-compose-laravel for my laravel

but when I'm using the command "docker-compose run --rm artisan migrate" it gives me an error.

Traceback (most recent call last):
  File "docker\utils\build.py", line 96, in create_archive
OSError: [Errno 22] Invalid argument: '\\\\?\\D:\\xampp\\htdocs\\laravel\\src\\vendor\\bin\\carbon'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 80, in main
  File "compose\cli\main.py", line 192, in perform_command
  File "compose\metrics\decorator.py", line 18, in wrapper
  File "compose\cli\main.py", line 947, in run
  File "compose\cli\main.py", line 1405, in run_one_off_container
  File "compose\project.py", line 664, in up
  File "compose\service.py", line 363, in ensure_image_exists
  File "compose\service.py", line 1107, in build
  File "docker\api\build.py", line 159, in build
  File "docker\utils\build.py", line 29, in tar
  File "docker\utils\build.py", line 99, in create_archive
OSError: Can not read file in context: \\?\D:\xampp\htdocs\laravel\src\vendor\bin\carbon
[4608] Failed to execute script docker-compose

Tried to check the second line on the bottom and I can't find the carbon on the vendor folder.

Upvotes: 2

Views: 610

Answers (2)

Gustavo Gaviria
Gustavo Gaviria

Reputation: 33

If you want a simpler solution and don´t need to bother about the docker files, you can try https://laradock.io/

It is very well documented.

To do the migration you can just run: docker-compose exec workspace bash

windows > docker-compose exec --user=laradock workspace bash
laradock@e2b7c1ad026b:/var/www$ php artisan migrate:fresh

Here is a good to guide to getting-started: https://laradock.io/getting-started/

Upvotes: 1

John Drex Astrande
John Drex Astrande

Reputation: 21

It seems I need to only restart my docker since it doesn't recognize the laravel after installation of it.

Upvotes: 0

Related Questions