Getting Started with Docker & Docker Engine


What is Dockerengine?

logo.pngOverview

Docker Engine is the heart of Docker, a technology that allows you to create and run small, lightweight packages called containers. These containers are like tiny virtual machines but much more efficient. They contain everything an application needs to run, including the code, system libraries, and settings, so it behaves the same on any computer.

Docker 101


Docker Engine consists of the following major components:

Docker Engine can run on any Linux-based operating system, including distributions like Debian, Ubuntu, and CentOS, as well as other systems like Windows and macOS using platform-specific adaptations. On Linux systems, Docker containers share the host's kernel, making them lightweight and highly efficient.

How Does Docker Engine Work?

At its core, Docker Engine uses a client-server model. You, the user, interact with Docker by typing commands (using the CLI) or through other software (via the REST API). The Docker Daemon (the server part) listens to these requests and manages all the containers on your system.

Key Features of Docker Engine

More Capabilities of Docker Engine

Interested on More?
Check Out "Docker Vs VM's"

Docker vs. VM

QA.JPEGOverview

In this article, we'll break down the differences between Docker and Virtual Machines (VMs), providing insights to help you decide which technology might be the better fit for your needs. Both Docker and VMs are essential tools for running applications, but they serve different purposes. Before diving into the comparison, let’s start with a brief explanation of each.

 

Backblaze_What-Are-Containers.png

What is Docker?

In today's rapidly evolving tech world, organizations aim to digitize their businesses, but often face challenges with managing diverse applications across cloud and on-premises infrastructure. Docker addresses this challenge by providing a container platform that can host traditional applications and modern microservices, running on both Linux and Windows.

Docker is a tool and a form of virtualization technology that simplifies the development, deployment, and management of applications. It achieves this by using containers, which are lightweight, self-contained packages that bundle everything needed to run an application, such as libraries, dependencies, and configuration files.

With Docker, applications run consistently across different systems because the container includes all the necessary elements. Containers are lightweight since they don’t need a separate operating system like virtual machines do. Instead, Docker containers share the host system’s OS kernel, making them faster and more efficient.

Key benefits of containers include:

Backblaze_What-Are-VMs.png

What is a Virtual Machine (VM)?

A Virtual Machine (VM), on the other hand, is a technology that allows a single physical machine to run multiple independent operating systems, each with its own resources. VMs are typically used when performing tasks that might be risky for the host system, such as running potentially harmful software or testing new operating systems. VMs offer strong isolation, so any issues inside a VM won't affect the host system.

Each VM is a complete system with its own operating system, virtual hardware, and resources like CPU, memory, and storage. A physical host can run multiple VMs, allowing for different environments to run simultaneously. VMs are commonly used in server virtualization, where a physical server is divided into several VMs to optimize hardware utilization.

There are two types of VMs:

While VMs provide strong isolation, they can consume a lot of resources since each VM includes its own operating system. This leads to longer boot times and higher resource usage compared to containers.

bb-bh-VMs-vs.-Containers-3.jpg

 

Docker vs Virtual Machines: Key Differences

Now that you know what Docker and VMs are, let's explore the key differences:

1. Architecture
2. Security
3. Portability
4. Performance
5. Resource Efficiency

Docker vs Virtual Machine Comparison Table

Feature Docker Virtual Machines (VMs)
Boot Time Starts in seconds Takes minutes to boot
Architecture Shares host OS kernel Each VM has its own guest OS
Memory Efficiency Lightweight, no need to virtualize Requires full OS for each VM
Isolation Limited isolation, shares host OS Full OS isolation
Deployment Quick and easy deployment Slower and more resource-intensive
Usage Best for containerized apps Better for full OS and high security

 

Should You Choose Docker or Virtual Machines?

Choosing between Docker and VMs depends on your use case:

Conclusion: Complementary Tools

Docker and virtual machines are not competing technologies, but rather complementary tools that serve different purposes. VMs provide strong isolation and are ideal for running applications that need their own OS, while Docker containers are lightweight, flexible, and designed for quickly deploying modern applications. Many organizations use both Docker and VMs in a hybrid approach, depending on the specific needs of their applications and infrastructure.

Both technologies have their strengths, and understanding the differences will help you make the right choice for your project.

Install Docker Engine on Debian

This Wikipage hase been integrated by aeoneros from the Original Source: Docker.Docks logo.png

To get started with Docker Engine on Debian, make sure you meet the prerequisites, and then follow the installation steps.

Prerequisites

OS requirements

OS Requirements

To install Docker Engine, you need the 64-bit version of one of these Debian versions:

Docker Engine for Debian is compatible with x86_64 (or amd64), armhf, arm64, and ppc64le (ppc64el) architectures.

Uninstall old versions

Uninstall Old Versions

fore you can install Docker Engine, you need to uninstall any conflicting packages.

Distro maintainers provide unofficial distributions of Docker packages in their repositories. You must uninstall these packages before you can install the official version of Docker Engine.

The unofficial packages to uninstall are:

Moreover, Docker Engine depends on containerd and runc. Docker Engine bundles these dependencies as one bundle: containerd.io. If you have installed the containerd or runc previously, uninstall them to avoid conflicts with the versions bundled with Docker Engine.

Run the following command to uninstall all conflicting packages:

for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done

apt-get might report that you have none of these packages installed.

Images, containers, volumes, and networks stored in /var/lib/docker/ aren't automatically removed when you uninstall Docker. If you want to start with a clean installation, and prefer to clean up any existing data, read the uninstall Docker Engine section.

Installation for Linux

Before you install Docker Engine for the first time on a new host machine, you need to set up the Docker apt repository. Afterward, you can install and update Docker from the repository.

1. Set up Docker's apt repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

If you use a derivative distro, such as Kali Linux, you may need to substitute the part of this command that's expected to print the version codename:
$(. /etc/os-release && echo "$VERSION_CODENAME")
Replace this part with the codename of the corresponding Debian release, such as bookworm.

2. Install the Docker packages

To install the latest version, run:

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

3. Verify that the installation is successful by running the hello-world image:

sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.

You have now successfully installed and started Docker Engine.