Cloud Docker quick reference
A quick reference of common commands for Docker Compose and Cloud Docker for Commerce CLI.
Docker Compose
Cloud Docker for Commerce uses the Docker Compose tool. The commands reflected in this guide are based on the latest usage defined in the docker compose CLI reference.
The following table lists the docker compose commands for building, deploying, and operating Cloud Docker for Commerce.
docker compose up -ddocker compose run --rm build cloud-builddocker compose run --rm deploy cloud-deploydocker compose run --rm deploy cloud-post-deploydocker compose run --rm deploy bashece-tools commanddocker compose run --rm deploy ece-command <command>docker compose run --rm deploy magento-command <command>docker compose down -vdocker compose stopdocker compose startdocker compose imagesdocker compose ps or docker psdata-variant=info
data-slots=text
--rm option automatically removes containers when they stop. This setting overrides any restart policy specified in the service configuration and prevents orphaned containers from consuming excess disk space. See docker composer run in the Docker command-line reference.Configuration generator
Use the Cloud Docker for Commerce .vendor/bin/ece-docker build:compose CLI commands to generate the Docker configuration files and build your environment.
Use the following command to view the available build options:
php ./vendor/bin/ece-docker build:compose -h
data-variant=info
data-slots=text
ece-docker build:compose command.Override configuration
Because the ece-docker build:compose command overwrites the base configuration, Adobe recommends 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:
docker compose -f docker compose.yml -f docker compose-custom.yml [-f more-custom-docker compose.yml] up
Cloud Docker CLI
Use the Cloud Docker for Commerce bin/magento-docker CLI commands to run docker compose tasks more efficiently. For example, instead of using a separate docker compose command for the build, deploy, and post-deploy tasks in the Docker environment, you can use the ece-redeploy command to complete all tasks.
./bin/magento-docker ece-redeploy
Use the following to connect to the bash shell and begin using the Cloud Docker CLI:
./bin/magento-docker bash
./bin/magento-docker bash./bin/magento-docker pull./bin/magento-docker ece-build./bin/magento-docker ece-deploy./bin/magento-docker ece-post-deploy./bin/magento-docker ece-redeploy./bin/magento-docker stop./bin/magento-docker start./bin/magento-docker restart./bin/magento-docker down./bin/magento-docker up./bin/magento-docker flush-redis./bin/magento-docker flush-varnish./bin/magento-docker ece-db./bin/magento-docker php <version>data-variant=help
data-slots=text1, text2
./bin/magento-docker -h