clean-docker / Magento2

Docker Image to Magento 2 local development in Mac, Linux and Windows
https://hub.docker.com/r/rafaelcgstz/magento2/
MIT License
444 stars 251 forks source link

Not working in Windows 10 #77

Open antoniocarrion opened 5 years ago

antoniocarrion commented 5 years ago

i'm trying using Windows 10 Pro and can't make it work. When i make a fresh install, everything goes fine. However, when i start customizing my project, executing setup:compile results in: Warning: include(/var/www/html/vendor/composer/../../generated/code/Magento/Framework/App/ResourceConnection/Proxy.php): failed to open stream: No such file or directory in /var/www/html/vendor/composer/ClassLoader.php on line 444

In addition, logs start to show this error: Class Magento\Framework\App\ResourceConnection\Config\Reader\Proxy generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. [] []

i tried absolutely everything without success. I guess that the issue is related to www-data user permissions, since every file under apache container has root as owner. So i manually edited /etc/group file in order to gran permissions, like that: root:x:0:www-data But issue still happens.

In addition, i have to say that i used to work with Windows 10 Home and Docker Toolbox, and have no permission issues, but it worked really slowly. That's the main reason i switched to Windows 10 Pro.

Any help will be appreciated. Thanks in advance, Antonio

kennedyabitbol commented 5 years ago

I made it work without any permissions issues but performance are still very low, you'd better create a ubuntu Hyper V machine and use it to make it runs, my opinion ;)

antoniocarrion commented 5 years ago

I tried using Virtual Box Ubuntu machine, @kennedyabitbol but performance is low, since i used a shared folder. I'll try with Hyper V.

Anyway, i hope that @rafaelstz can point out something

LiamKarlMitchell commented 4 years ago

Performance is super slow on windows with Hyper V, WSL 1 or Virtual Box. Attempting Windows 10 build 2004 Ubuntu via WSL 2.

Windows 10 WSL 2 running Ubuntu. Errors on install from this command.

Creating magento-local_apache_1        ...

ERROR: for magento-local_apache_1  a bytes-like object is required, not 'str'

ERROR: for phpmyadmin  a bytes-like object is required, not 'str'

ERROR: for apache  a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 261, in _raise_for_status
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http+docker://localhost/v1.22/containers/6e21be8c7fa03be7734733c2c5f061726f3098cd2026dd6937058d5549c94f96/start

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/compose/service.py", line 625, in start_container
    container.start()
  File "/usr/lib/python3/dist-packages/compose/container.py", line 241, in start
    return self.client.start(self.id, **options)
  File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped
    return f(self, resource_id, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/docker/api/container.py", line 1095, in start
    self._raise_for_status(res)
  File "/usr/lib/python3/dist-packages/docker/api/client.py", line 263, in _raise_for_status
    raise create_api_error_from_http_exception(e)
  File "/usr/lib/python3/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception
    raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 500 Server Error: Internal Server Error ("b'driver failed programming external connectivity on endpoint magento-local_apache_1 (614d8775f6b15e0deb2f8ec725876b6bf840b31520f55431df75ca1862125a21): Bind for 0.0.0.0:80 failed: port is already allocated'")

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 11, in <module>
    load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main
    command()
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 128, in perform_command
    handler(command, command_options)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1107, in up
    to_attach = up(False)
  File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 1088, in up
    return self.project.up(
  File "/usr/lib/python3/dist-packages/compose/project.py", line 565, in up
    results, errors = parallel.parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/project.py", line 548, in do
    return service.execute_convergence_plan(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 545, in execute_convergence_plan
    return self._execute_convergence_create(
  File "/usr/lib/python3/dist-packages/compose/service.py", line 460, in _execute_convergence_create
    containers, errors = parallel_execute(
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 112, in parallel_execute
    raise error_to_reraise
  File "/usr/lib/python3/dist-packages/compose/parallel.py", line 210, in producer
    result = func(obj)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 465, in <lambda>
    lambda service_name: create_and_start(self, service_name.number),
  File "/usr/lib/python3/dist-packages/compose/service.py", line 457, in create_and_start
    self.start_container(container)
  File "/usr/lib/python3/dist-packages/compose/service.py", line 627, in start_container
    if "driver failed programming external connectivity" in ex.explanation:
TypeError: a bytes-like object is required, not 'str'

But I suspect that this is because the port is already in use. Ignoring.

Before install, composer very very slow, lets use this to have parallel

docker-compose exec apache bash
composer global require hirak/prestissimo
exit