| 1. |
What’s The Difference Between Up,run, And Start? |
|
Answer» Typically, you want DOCKER-compose up. Use up to start or RESTART all the services defined in a docker-compose.yml. In the default “attached” mode, you’ll SEE all the logs from all the containers. In “detached” mode (-d), Compose exits after starting the containers, but the containers continue to run in the background. The docker-compose run command is for running “one-off” or “adhoc” tasks. It requires the service name you want to run and only starts containers for services that the running service depends on. Use run to run tests or perform an administrative task such as removing or adding data to a data volume container. The run command ACTS like docker run -ti in that it opens an interactive terminal to the container and returns an EXIT status matching the exit status of the process in the container. The docker-compose start command is useful only to restart containers that were previously created, but were stopped. It never creates new containers. Typically, you want docker-compose up. Use up to start or restart all the services defined in a docker-compose.yml. In the default “attached” mode, you’ll see all the logs from all the containers. In “detached” mode (-d), Compose exits after starting the containers, but the containers continue to run in the background. The docker-compose run command is for running “one-off” or “adhoc” tasks. It requires the service name you want to run and only starts containers for services that the running service depends on. Use run to run tests or perform an administrative task such as removing or adding data to a data volume container. The run command acts like docker run -ti in that it opens an interactive terminal to the container and returns an exit status matching the exit status of the process in the container. The docker-compose start command is useful only to restart containers that were previously created, but were stopped. It never creates new containers. |
|