# Learn Docker: Quick and Dirty

Docker has revolutionized the way we deploy and manage applications. It's a powerful tool for containerization, allowing you to package and run applications and their dependencies in isolated environments called containers. If you're new to Docker and want to get started quickly, this guide will walk you through the basics.

### **Step 1: Install Docker**

The first step is to install Docker on your system. Go to the [**Docker website**](https://www.docker.com/) and download the Docker Desktop application for your operating system (Windows, macOS, or Linux). Follow the installation instructions for your OS and launch Docker Desktop.

### **Step 2: Verify Installation**

After installation, open a terminal or command prompt and run:

```python
docker --version
```

This command should display the Docker version, confirming that it's installed and running.

### **Step 3: Hello World Container**

Let's start by running a simple "Hello World" container to ensure everything is working correctly. In your terminal, enter:

```python
docker run hello-world
```

Docker will download the "hello-world" image (if not already downloaded) and run it in a container, displaying a confirmation message.

### **Step 4: Understanding Images and Containers**

Docker uses images as blueprints to create containers. You can search for images on [**Docker Hub**](https://hub.docker.com/) and pull them to your system using `docker pull`.

### **Step 5: Running a Custom Container**

To run your own application in a container, create a Dockerfile that describes the application and its dependencies. Then, build an image from the Dockerfile using:

```python
docker build -t my-custom-app .
```

Replace `my-custom-app` with a suitable name for your image. Run a container from the image with:

```python
docker run -d -p 8080:80 my-custom-app
```

This command runs the container in detached mode and maps port 8080 on your host to port 80 in the container.

### **Step 6: Managing Containers**

You can manage containers with simple commands. To list running containers:

```python
docker ps
```

To stop a container:

```python
docker stop container_id
```

And to remove a stopped container:

```python
docker rm container_id
```

### **Step 7: Cleanup**

Docker can consume disk space, so periodically clean up images and containers you no longer need with:

```python
docker system prune
```

### **Step 8: Learn More**

Docker has many advanced features and options. To learn more, refer to the [**official Docker documentation**](https://docs.docker.com/). You can also explore Docker Compose for managing multi-container applications.
