← TEK2 videos

docker run vs docker exec — new container vs existing one

Week 01 · 3 min

Download MP4

What this covers

The one distinction that trips up every beginner: `run` creates a new container, `exec` enters one that's already running.

  1. The scenario: your web server is running; you want to look inside
  2. The wrong reaction: docker run — creates a new container
  3. The right tool: docker exec
  4. In one line: run creates, exec enters
  5. Common everyday uses of exec