What is the difference between Docker commands: up, run and start?

0

We have up and start commands in docker-compose. The run command is in docker.

  1. Up: We use this command to build, create, start or restart all the services in a docker-compose.yml file. It also attaches to containers for a service. This command can also start linked services.
  2. Run: We use this command for ad-hoc requests. It just starts the service that we specifically want to start. We generally use it to run specific tests or any administrative tasks.
  3. Start: This command is used to start the container that was previously created but is not currently running. This command does not create new containers.
Devops docker
asked Apr 30, 2023 at 20:52
Sign in to add a comment

0 Answers

0
📝 No answers yet!

Be the first to answer this interview question.

Your Answer

Sign in to post your answer and help the community.