This devcontainer provides a complete development environment for Magento 2 that meets Adobe's official system requirements.
- VSCode (or an editor that supports devcontainers)
- Docker
- Github Codespaces (Optional)
This environment will support all of the currently supported Magento versions. There are multiple configurations available (one for each major version of Magento).
| Magento Version | Configuration |
|---|---|
| v2.4.6 | compose/2.4.6/docker-compose.yml |
| v2.4.7 | compose/2.4.7/docker-compose.yml |
| v2.4.8 | compose/2.4.8/docker-compose.yml |
| v2.4.9 | compose/2.4.9/docker-compose.yml |
- Make a .devcontainer folder in your project
mkdir -p .devcontainer- Add this repository as a git submodule to your Magento project:
git submodule add https://github.com/graycoreio/magento2-devcontainer.git .devcontainer/magento2-devcontainer- Run the
initscript
/bin/bash .devcontainer/magento2-devcontainer/bin/init.sh[!INFO] If you're on Windows (and not using WSL2) and don't have access to bash, you can simply get away with copying the sample
devcontainer.json.sample,docker-compose.overrides.ymland making a simpledocker-compose.ymlwith the following content into your .devcontainer folder:
services: {}-
Open the project in VS Code and click "Reopen in Container" when prompted.
-
(Optional) Run the
setupscript
/bin/bash .devcontainer/magento2-devcontainer/bin/setup-install.sh