Docker development quick reference
docker-compose
Action | Command |
---|---|
Build and start Docker environment | docker-compose up -d |
Build environment | docker-compose run build cloud-build |
Deploy environment | docker-compose run deploy cloud-deploy |
Run post-deploy hooks | docker-compose run deploy cloud-post-deploy |
Connect to CLI container | docker-compose run deploy bash |
Use ece-tools command |
docker-compose run deploy ece-command <command> |
Use Magento command | docker-compose run deploy magento-command <command> |
Stop and remove Docker environment (removes volumes) | docker-compose down -v |
Stop Docker environment without destroying containers | docker-compose stop |
Resume Docker environment | docker-compose start |
List images | docker-compose images |
List containers and ports | docker-compose ps or docker ps |
Override configuration
Because the ece-docker build:compose
command in the ece-tools
package overwrites the base configuration, we recommend saving your customizations in an override configuration file. You can use this method to merge multiple custom configurations. See Docker Docs: Multiple Compose files.
The docker-compose up
command considers the base docker-compose.yml
configuration by default. If the docker-compose.override.yml
file is present, then the override configuration merges with the base configuration.
Use the -f
argument to specify an alternate configuration file. The following example uses the default configuration and merges each custom configuration sequentially:
1
docker-compose -f docker-compose.yml -f docker-compose-custom.yml [-f more-custom-docker-compose.yml] up
Build options
Option | Key | Available values |
---|---|---|
Mode | --mode , -m |
production, developer |
File synchronization engine | --sync-engine |
native (default), docker-sync, mutagen |
See Service versions for a list of the options to configure the software service version when building your Magento Cloud Docker environment.
bin/magento-docker
Run bin/magento-docker
commands using the following format:
1
./bin/magento-docker <command>
For example, to connect to the bash shell:
1
2
3
4
5
6
$ ./bin/magento-docker bash
Starting project_redis_1 ... done
Starting project_db_1 ... done
Starting project_elasticsearch_1 ... done
[ ok ] Starting enhanced syslogd: rsyslogd.
root@deploy:/app#
Action | Command |
---|---|
Connect to bash shell | bash |
Pull the latest images | pull |
Build application | ece-build |
Deploy application | ece-deploy |
Run post-deploy hooks | ece-post-deploy |
Re-build and re-deploy application | ece-redeploy |
Stop containers | stop |
Start containers | start |
Restart containers | restart |
Destroy containers | down |
Destroy, re-create, and start containers | up |