
What are (Docker) containers?
Containers
There are more defininitions what a (Docker) container is, here is one general definition:
- A container is like a self-contained environment for your code. It includes everything needed to run an application: the application code, runtime, system tools, system libraries, and settings. It can even run an operating system (OS)
- Containers are designed to be isolated from the host system and other containers. They run consistently across different environments, ensuring that your application behaves the same way regardless of where it’s deployed.
In general container characteristics are that they are lightweight, portable and secure.
Check out these sources for more information:
https://www.docker.com/resources/what-container/
https://en.wikipedia.org/wiki/Docker_(software)
Images
To create or deploy a container you need an container image. An image is a standalone package that contains everything needed to run an application. It includes the application code, dependencies and configuration.
An image can even contain an operating system (OS).
In summary, images are like blueprints, while containers are the actual instances built from those blueprints.
Volumes
A Volume is a file location on your host where all additional data is stored after you have created a new Container based on an Image. This Volume can contain configuration settings, database, text files, etc.
More information about Volumes:
https://www.docker.com/blog/top-tips-and-use-cases-for-managing-your-volumes/
Virtual Machines(?)
When you compare a container to a virtual machine (VM) there is a big difference:
Containers virtualize the operating system (OS), not the hardware and they can contain applications and all dependencies.
Virtual machines virtualize the entire hardware stack including the operating system (OS).
