How to understand the difference between docker-compose’s up vs run vs exec commands

Zhao Li
Analytics Vidhya
Published in
13 min readJun 9, 2019

--

Problem

You are starting to use containers and noticed Docker Compose offers multiple ways of running containers, namely up, run, and exec. What is the difference between each and when would you want to use one over the other?

Solution

Majority of the time, you will most likely want to bring up all of the services listed in your docker-compose.yml and have the containers run their default command, so you would want to use up.

--

--