Start, stop, restart, and check container status in Docker
Learn how to manage containerized services by starting, stopping, restarting, and checking their status.
Lesson Content
The most basic helper scripts in docker-magento are bin/start, bin/stop, and bin/restart.
To start the project, run:
bin/startThis command runs automatically after you set up Magento. You need to run it again whenever you restart your host machine or restart the Docker daemon. It starts all the services defined in the docker-magento YAML files.
To stop the project, run:
bin/stopThis stops all the containers and services. You need to run bin/stop before starting another docker-magento project.
You can install as many docker-magento projects on one machine as you want, but only one project can run at a time. Stop the current project before starting another one.
The bin/restart script stops the containers and starts them again:
bin/restartThis is equivalent to running bin/stop followed by bin/start. Use it after changing an INI or other configuration file when the services need to restart before the changes take effect.
Finally, use bin/status to check the status of all the services:
bin/statusLook at the STATUS column to see whether each service is running. A running service has a status such as Up. If you stop the containers and run the command again, their status is exited:
bin/stop
bin/statusThis gives you a quick way to check whether all the services are running and to identify a specific service that failed to start.
Join the discussion!
Comments
Want to comment on this lesson?
Log in to leave comments.