# What Is a Container? — Docker Fundamentals: Images, Containers and Compose

Source: https://www.skillbyai.com/en/docker/docker-what-is-a-container

> Learn what a container is, why it solves it-works-on-my-machine problems and how it differs from a virtual machine.

## The problem: "it works on my machine"

An app that runs fine on your laptop can fail on a server because of different OS versions, missing libraries, or config drift. **Docker** packages the app with its exact environment so it behaves the same everywhere.

## Shipping container analogy

Just like a physical shipping container holds any cargo and loads onto any ship or truck the same way, a **Docker container** holds your app and runs the same way on any machine with Docker installed.

## Containers vs virtual machines

A VM virtualizes an entire machine, including its own OS kernel — heavy and slow to boot. A container shares the host's kernel and only isolates the process, so it's **lighter, faster to start, and uses fewer resources**.
