Skip to main content

Container Management

Creating and Running Containers

0:00
LearnStep 1/4

Docker Run Basics

Docker Run Command

The docker run command creates and starts a container from an image.

Basic Syntax

bash

Simple Examples

bash

What Happens When You Run

  1. Docker checks if image exists locally
  2. If not, pulls image from registry
  3. Creates a new container
  4. Allocates filesystem and mounts read-write layer
  5. Allocates network interface
  6. Sets up IP address
  7. Executes specified command
  8. Captures and logs output

Container vs Process

bash