docker-magento2
docker-magento2 copied to clipboard
Cannot install Magento 2.2
When installing Magento 2.2 I received the following exception:
[Magento\Framework\Exception\LocalizedException]
NOTE: Manual static content deployment is not required in "default" and "developer" modes.
In "default" and "developer" modes static contents are being deployed automatically on demand.
If you still want to deploy in these modes, use -f option: 'bin/magento setup:static-content:deploy -f'
It's also worth mentioning that the var/generation
folder is now in the magento root, which in the install script will be attempted to be emptied. While the script won't fail, it won't succeed in the goal of emptying the dir.
Happy to submit a PR, any opinions on handling the 2.2 changes whilst maintaining backwards compatibility would be appreciated.
I've been wanting to rewrite that magento-installer
script for a while (converting it to PHP in the process like magento-extension-installer
), because it does a lot of things that are not very flexible or best practice anymore. But until I (or someone else) get around to that...
Instead of trying to specifically target 2.2 and pre2.2, I'd suggest targeting Magento modes instead. I think at least some of the images include a MAGENTO_RUN_MODE
environment variable. If we are installing Magento with the intention of running it in production mode, I would replace the setup:static-content:deploy
line with a deploy:mode:set
, which runs through compilation and asset deployment as part of the command. If we're not in production mode, I'd simply skip that line as, like the exception says, there's no need for it - Magento can generate assets on the fly in non-production modes anyway.
As for the var/generation
issue, I'd probably rethink if there's better ways of installing that doesn't require us to chown
/chmod
files. Perhaps we should run the script as www-data
to start with (could be done with ensuring the script itself is owned by www-data
and has the g+s
permissions), assuming we don't need any actions reserved for root user.
I've installed 2.2 successfully , and everything is working fine . above one exception is coming but that did not effect anything for me.
As a short term fix might be an idea to include an option to toggle the f param as deploy static content will work without it in 2.1.* but not in 2.2.* on default and developer mode.