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

# Overview

## What is Docker?

A platform to help deploy and run applications quickly. It containerises (virtualisation) the application to separate from the OS infrastructure without relying on your OS but the resource of the underlying hardware. This allows deployment on servers that may differ in OS but do not require a specific OS build script to build and deploy.

## Containers vs Virtual Machiines

![Resources Map of Containers and Virtual Machines](/files/lI473LtMz16UEsPT6kWo)

Virtual machines rely on hypervisor to separate the resource and create multiple virtual servers from a singular hardware server. This multiplies the number of application dependencies per virtual servers. In most situations, a dedicated virtual server is not needed to run a single application.

Containers installs a barebone linux image with only the necessary packages needed to run the application therefore, it tends to be very small and lightweight. As such container orchestration tool like Kubernetes may be needed to manage massive numbers of containers.

## Use Cases

### Microservices Architecture

As discussed in [Microservices](/interview-bank/software-architecture/overview.md), loosely coupled and independent services are essential to the architecture. Container helps to fulfill the requirements by separating services while accelerating development and deployment time. Docker's multi stage build feature enables incremental migration without the need to rebuild the infrastructure. This helps in building modular and scalable solutions.

### App Development Improvements

Containers allows easy packaging of apps and dependencies into a single unit and reduce the need for manual configuration for each environment. Furthermore, testing can also be automated into the build file so there is no need for dedicated test scripts due to host OS differences. This allows more time spent on app development and modification of build and test scripts can be applied to all containers.

### Consistent Environment Deployments

Everyone's environment for development, building and testing will differ which may chance upon different errors. Containerization helps to maintain a single stable build OS image that can be deployed on different devices without relying on their host environment. Having isolation and consistent replication enables smooth process between different deployment environments.

{% embed url="<https://cloud.folio3.com/blog/docker-use-cases/>" %}

## Container Alternatives

{% embed url="<https://podman.io/>" %}

{% embed url="<https://linuxcontainers.org/>" %}

{% embed url="<https://buildah.io/>" %}

## Interview Questions

* Explain how containers work?
* What are the difference(s) between containers and virtual machines?
* Name 5 use cases of containerizations.

## Author

* [Zheng Jie](https://github.com/Bread7) 🍞

## References

1. [Docker - Overview](https://docs.docker.com/get-started/overview/)
2. [RedHat - Containers vs VMs](https://www.redhat.com/en/topics/containers/containers-vs-vms#which-one-should-i-use)
3. [Folio3 - Docker Use Cases](https://cloud.folio3.com/blog/docker-use-cases/)


---

# 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, and the optional `goal` query parameter:

```
GET https://greenhat.gitbook.io/interview-bank/docker/overview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
