~/ What is Docker? Understanding Containers, Images, and More

Learn what Docker is, how containers and images work, and how to deploy applications like SearXNG easily using Docker.

July 7, 2025

|

10 min read

Docker
Containers
DevOps
Virtualization
Linux Tools
Beginner Friendly

Docker has transformed how developers build, ship, and run applications. Instead of manually configuring environments or relying on full virtual machines, Docker lets you package your application and its dependencies into a lightweight, portable unit called a container. But what exactly are containers, images, and how does Docker make it all work? Let's explore.

Docker is an open-source platform designed to automate the deployment of applications inside software containers. These containers are isolated, lightweight environments that include everything an application needs to run-code, runtime, system tools, libraries, and settings.

Docker enables you to run applications the same way across any environment-whether it's your laptop, a server, or the cloud.

  • Portability: Docker containers run the same across different systems.
  • Isolation: Each container runs in its own environment, reducing conflicts.
  • Speed: Containers are lightweight and start faster than virtual machines.
  • Efficiency: Containers use fewer resources than traditional VMs.

While both containers and VMs provide isolated environments, they differ in how they achieve that:

FeatureContainersVirtual Machines
System OverheadLowHigh (includes full OS)
Startup TimeSecondsMinutes
Resource ConsumptionMinimalHigh
PortabilityHighModerate

Containers share the host OS kernel, whereas VMs require a full guest OS, which makes containers much lighter.

This is the core component that runs on the host machine. It manages containers and interacts with images and volumes.

A Docker image is a read-only template that defines the contents of a container. Think of it as a snapshot of an environment. Images can be built manually using a Dockerfile, or pulled from registries like Docker Hub.

A container is a running instance of an image. It uses a copy-on-write filesystem and can be stopped, started, or deleted without affecting the underlying image.

A text file with instructions for building a Docker image. For example:

Dockerfile

FROM python:3.12 COPY . /app WORKDIR /app RUN pip install -r requirements.txt CMD ["python", "app.py"]

Volumes are used to persist data generated by and used in Docker containers. Unlike the container's filesystem, which is ephemeral, volumes preserve data even when containers are removed.

  • docker pull <image> – Download an image.
  • docker build -t <name> . – Build an image from a Dockerfile.
  • docker run <image> – Run a container.
  • docker ps – List running containers.
  • docker stop <container> – Stop a container.
  • docker rm <container> – Remove a container.

SearXNG is a privacy-respecting metasearch engine. You can easily deploy it with Docker using the following command:

Bash

sudo docker run --name searxng -d \ -p 80:8080 \ -v "./config/:/etc/searxng/" \ -v "./data/:/var/cache/searxng/" \ docker.io/searxng/searxng:latest

  • --name searxng: Names the container "searxng".
  • -d: Runs the container in detached mode (in the background).
  • -p 80:8080: Maps port 8080 inside the container to port 80 on your host.
  • -v "./config/:/etc/searxng/": Mounts a config directory from host to container.
  • -v "./data/:/var/cache/searxng/": Mounts a data directory to persist cache.
  • docker.io/searxng/searxng:latest: Specifies the Docker image to use.

Once the container is running, SearXNG should be accessible via http://localhost.

Docker makes software deployment and environment management simpler, faster, and more reliable. Whether you're a developer looking to streamline local development or a sysadmin managing scalable deployments, Docker is an essential tool in the modern software stack.

Want to explore more? Try creating your own Dockerfile, or check out multi-container setups using Docker Compose.

Happy Dockering!