Accessing Docker containers
Create Magento App consists of Magento, Docker containers with Redis, Elasticsearch, Nginx, and MySQL, and CLI to connect all of these things together. We already have a CLI command that gives us access to Magento CLI and Composer CLI, but how can we access the containers? That is where the connect command comes in handy!
1
yarn run exec <container name> # for Yarn
2
npm run exec <container name> # for NPM
Copied!
Now we are inside of a chosen container. Here is a list of available container names:
  • mysql
  • nginx
  • redis
  • elasticsearch

Common Usage

1
yarn run exec mysql
2
3
>[email protected]:/# # inside a mysql container
4
5
# ctrl + d or type 'exit' and press enter
6
7
# this is not alias, but rather service name matching
8
yarn run exec m
9
10
>[email protected]:/# # inside a mysql container
11
Copied!
Last modified 4mo ago
Copy link
Contents
Common Usage