> For the complete documentation index, see [llms.txt](https://42-guide.gitbook.io/42-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://42-guide.gitbook.io/42-guide/docker.md).

# Docker

## What is Docker?

Docker is like a *magic box* for developers and IT teams. It helps you run your apps in small, isolated containers, so they work the same way no matter where you use them—on your computer, in a data center, or in the cloud.

Here’s a simple way to think about it:

* Imagine you want to ship a **cake** to someone. You don’t just send the raw ingredients like flour, eggs, and sugar; you bake the cake, pack it in a box, and send it. The box keeps the cake safe and ensures it arrives ready to eat, no matter where it goes.
* Docker does the same for apps. Instead of sending raw code and hoping it works on another computer, Docker packages the app, its tools, and everything it needs (like a specific Python version or database) into a **container**.

#### Why is Docker useful?

1. **Works Everywhere**: The container has everything your app needs, so it runs the same on any computer.
2. **Saves Time**: Developers don’t need to spend hours fixing “it works on my machine” issues.
3. **Efficient**: Containers are lightweight compared to full virtual machines, saving resources.

#### Key Terms:

* **Image**: A blueprint for your app (like a recipe for a cake).
* **Container**: The actual app running from the image (like a baked cake in a box).
* **Docker Hub**: A store for sharing images (like an online bakery!).

#### Example:

You can run a simple web server using Docker:

```bash
docker run -d -p 80:80 nginx
```

This command downloads an image (nginx), runs it in a container, and makes it available on your browser.

In short, Docker is a tool to make running and sharing apps easier, faster, and more reliable!


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://42-guide.gitbook.io/42-guide/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
