Sign In
Sign In

Docker Complete Guide: All You Need to Know About Docker and Docker Containers

Docker Complete Guide: All You Need to Know About Docker and Docker Containers
Hostman Team
Technical writer
Infrastructure

Want to know what a Docker container is? In this guide, we’ll learn everything about Docker and find out what a Docker container is. We’ll also tell you how to run Docker containers and what’s the difference between docker images and containers.

If you want to really understand the thought process behind Docker, there’s no better source than the person who created it - Solomon Hykes, founder and CTO of dotCloud. Although this YouTube introduction was uploaded 7+ years ago, it is still perfectly relevant.

That said, you might not have 47 minutes to spare on watching the full presentation, especially since it’s pretty technical and might require multiple viewings. That’s why we’ve created this quick guide for you.

What is docker?

Docker is a lightweight, open-source virtualization tool.

Here’s the description on Docker’s official website:

“Docker takes away repetitive, mundane configuration tasks and is used throughout the development lifecycle for fast, easy and portable application development - desktop and cloud. Docker’s comprehensive end to end platform includes UIs, CLIs, APIs and security that are engineered to work together across the entire application delivery lifecycle.”

Architecture

Docker runs at the operating system level. It automates the deployment of applications in Linux containers, and allows you to package an application with all the necessary dependency structures (code, runtime, libraries, environment variables, configuration files) into a container.

In his presentation, Solomon breaks down the unique proposition that distinguishes Docker from other solutions out there:

"A lot of [container] tools use containers as miniature servers… just like a VM [virtual machine] but way faster…. We [Docker] use containers as a unit of software delivery."

What are Docker containers and what are they used for?

A container is an isolated environment whose processes do not interfere with operations outside of it.

Docker Containerized Appliction Blue Border 2

The container only uses a portion of the operating system. This allows you to significantly reduce the consumption of system resources by allocating the application and its data exclusively to the container, rather than to the entire operating system as in the case of a virtual machine.

This makes Docker containers particularly suited to rapid application deployment, ease of testing, maintenance, and troubleshooting, while enhancing security.

One of the practical benefits of Docker containers is simplifying big development team work. Tasks can be easily split up and implemented in different programming languages.

Common use cases for Docker include:

  • Automating the packaging and deployment of applications

  • Creating lightweight, private PAAS environments

  • Automating testing and continuous integration/deployment

  • Deploying and scaling web apps, databases and backend services

How does a container work?

There are five basic tenets of Docker containers:

  1. The lifespan of a container is tied to the lifespan of the process contained within it.

  2. Inside the container, this process has pid = 1, which means it is the parent process that starts before all other processes.

  3. Alongside the process with pid = 1, you can spawn as many other processes as you wish (within the limitations of the OS). Killing (restarting) the process with pid = 1 stops the container. (see item 1)

  4. Inside the container, you will see the usual FHS-compliant directory layout. This location is identical to the source distribution (from which the container is taken).

  5. The data created inside the container remains in the container and is not saved anywhere else. The host OS has access to this layer, but deleting the container will discard all changes. For this reason, the data is not stored in containers, but taken out to the host OS.

How to create a Docker container

In this guide, we’ll be showing you how to install Docker on Ubuntu 20.04 - the most popular repository.

We recommend you to use official Docker files for installation, you can find all the needed info here. No complicated configuration is required at this stage. Once it’s finished installing, start the service, check its status and set it to start at boot:

sudo apt-get update

sudo apt-get install \

apt-transport-https \

ca-certificates \

curl \

gnupg \

lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo \

"deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu

\$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io

systemctl start docker

systemctl enable docker

systemctl status docker

99291a659bfe8515e256a2a86458da8e

Next, run a test image to check that Docker is working correctly:

docker run hello-world

You should see the following message:

“Hello from Docker. This message shows that your installation appears to be working correctly."

7fad108ef513aff62bda5d0163401ee7

How to list Docker containers

To avoid having to recognize and remember the container ID, you can assign a unique name to each container by using the -name command line option when creating it. See the example below:

docker run --name myname ubuntu cat / etc / debian_version

Once you’ve done this, you can start using the container (execute the start, stop, remove, top, stats commands) by referring to it by name, for example:

docker start myname – container start

docker stats myname – display resource usage statistics

docker top myname – displays the processes running in the container

How to start and restart Docker containers?

To start the container in daemon mode, use the -d option.

docker run -td ubuntu bash

To reconnect to a running container, you need to know its ID or name. Run the Docker ps command, followed by attach and the container’s ID or name.

docker attach CONTAINER

How to stop Docker container

A container is usually terminated automatically after the completion of the process. However, there might be instances where you want to terminate the container yourself. The stop command performs a "soft" shutdown of the container, by default allowing 10 seconds for all processes to terminate:

docker container stop CONTAINER

If you want immediate termination, you can execute the kill command. However, in most situations, using stop is preferable.

docker container kill CONTAINER

Here’s the command for immediate termination of all running containers:

docker container kill $ (docker ps -q)

How to delete a container

To delete a Docker container, use the following command:

docker container rm CONTAINER

Here’s how to remove all Docker containers that are not running:

docker container rm $ (docker ps -a -q)

How to run Docker containers

To interactively connect to the shell of the container and run commands, as in a regular Linux system, you need to create a container with the following settings:

docker container run -it ubuntu bash

The structure of this command is as follows:

  • -i sets the start of an interactive session.

  • -t allocates TTYs and includes standard input and output streams.

  • ubuntu is the image used to create the container.

  • /bin/bash is a command run in an Ubuntu container.

After starting the container with the above settings, we sort of fall into the container. Use the exit command to exit a running session and return to your node's terminal. This interrupts all container processes and stops the container:

exit

If you are interactively connected to a container and need to log out without interrupting the session, you can exit the console and return to your host's terminal by pressing Ctrl + P and then Ctrl + Q.

There are several services that help users to easily deploy Docker containers with just a few clicks. Hostman has swiftly earned a reputation for being the go-option when it comes to GitHub, Bitbucket, or GitLab repositories.

How to SSH into a Docker container?

For SSH authentication, or when connecting remotely (for example, rsync), the main methods are a login-password pair (the password is entered from the keyboard in the console) and key authorization (a private-public key pair is created on the server and the public key is transmitted to the remote server). The first method cannot be used in any way in scripts executed on the crown, and it is necessary to configure a transparent input.

Generating keys for the current user:

ssh-keygen -t rsa

After entering this command you’ll be asked some questions. You can just agree with all the default options.

Copy the key to the remote server (enter the password of the remote server once).

ssh-copy-id -i ~ / .ssh / id_rsa user@ssh-server

Checking the ability to log in:

ssh user@ssh-server

How to connect to a running container?

If you have multiple Docker containers running and want to choose which one to work with, you will need to list them by using the ls command. In addition to displaying a list of containers, this command also displays useful information about them. The command without any settings displays a list of running containers:

docker container ls

7d95801c8da635db78c9016a4f02abe4

The -a setting tells the command to list all containers, not just running ones, while the -s option displays the size of each container:

docker container ls -a

B1740f948e903784f709c66967e2cba6

The inspect setting displays a lot of useful information about the container:

docker container inspect CONTAINER

To display container logs, run the logs command:

docker container logs CONTAINER

What is the difference between a Docker container and a Docker image?

Docker works with the following fundamental objects:

  • A container is an application environment. When a container is launched from an image containing the necessary configuration data, a new level with a variable structure is built on top of this image. If you save the changes, the new image level is saved and the old one remains unchanged.

  • An image is a static snapshot of a container's configuration state. The image is a permanent layer, all changes are made at the highest level and are saved only by creating a new image. Each image depends on one or more parent images.

Why are Docker images so valuable?

Docker images are valuable because they are used to create and conduct the environment to get started with Docker. First, you will need to download an image from the Docker Hub to your machine.

What benefits do containers offer?

When working with application containerization in Big Data, the following advantages of this technology are most significant:

  1. Standardization – thanks to the base of open standards, containers can work in all major distributions of Linux, Microsoft and other popular operating systems;

  2. The independence of the container from the resources or architecture of the physical host on which it runs, facilitates portability of the container image from one environment to another, providing a continuous pipeline of DevOps processes from development and testing to deployment (CI / CD pipeline);

  3. Isolation – the application in the container runs in an isolated environment and does not use the memory, processor or disk of the host OS. This guarantees the isolation of processes inside the container and provides some level of security.

  4. Reusability – all the components required to run the application are packaged into one image that can be run multiple times;

  5. Fast deployment – creating and launching a container is considerably less time-consuming than using a virtual machine instance or setting up a full-fledged working environment;

  6. Increasing labor productivity – having each microservice of a complex system packaged in a separate container for which one developer is responsible, makes it possible to parallelize work tasks without mutual dependencies and conflicts;

  7. Simplified Monitoring – versioning container images makes it possible to track updates and prevent synchronization issues.

Summary

Supporting Big Data applications (yours or others’) that no longer fit in your head, doesn’t have to be a nightmare anymore.

With this handy guide to Docker, you’ll be able to cold-start an application on a new machine, with just a few clicks, in under a minute.

More importantly, with the reassurance that all of your data is safe, you’ll finally be able to focus exclusively on writing useful code instead of wasting time and energy on server-related troubleshooting.

Infrastructure

Similar

Infrastructure

Hybrid Cloud Computing: Architecture, Benefits, and Use Cases

A hybrid cloud is an infrastructure model that combines private and public cloud services. Private clouds are owned by the company, while public clouds rely on provider resources, such as Amazon Web Services (AWS), Microsoft Azure, or Hostman. Hybrid Cloud Architecture The architecture of a hybrid cloud consists of the company’s own data center, external resources, and private hosting. These components are connected through a unified management process. The key feature of the hybrid approach is the ability to connect systems that handle business-critical data, which cannot be placed on public infrastructure, while still leveraging the advantages of external hosting, such as on-demand scaling. Hybrid Cloud Advantages Hybrid cloud addresses the limitations of both public and private cloud services. It is a compromise solution with several important benefits: Reduced computing costs compared to relying solely on in-house hardware. Flexible management: critical data can remain on private infrastructure, while less sensitive workloads can be handled by the provider. Easy scalability by using resources offered by cloud providers. Disadvantages Some drawbacks of hybrid cloud include: Integration complexity: establishing a reliable connection between private and public environments can be challenging. Risk of failure: if resources are poorly distributed or one segment fails, the entire system may be affected. Oversubscription: some providers may allocate the same resources to multiple clients. Such issues can be avoided by carefully selecting a provider. For instance, when configuring a hybrid cloud on Hostman, you can rely on expert support and guaranteed access to the resources you pay for. Use Cases Here are several examples of situations where hybrid cloud infrastructure is particularly useful: Rapid Project Scaling Suppose you run an online store. During high-traffic events like Black Friday, website traffic spikes dramatically. Cloud architecture reduces the risk of server crashes during peak loads. Additional resources can be deployed in the cloud as needed and removed once demand decreases, preventing unnecessary costs. Scalability is also crucial for big data processing. Using cloud resources is more cost-effective than maintaining a large in-house data center. Data Segregation Confidential client information can be stored in a private cloud, while corporate applications run on public cloud infrastructure. Public hosting is also suitable for storing backup copies, ensuring business continuity if the primary system encounters problems. Development and Testing External cloud resources can be used for deployment and testing, allowing teams to simulate workloads and identify bugs not visible in local environments. After validation, the new version can be deployed to the main infrastructure. Conclusion Hybrid cloud is a practical approach for companies that value flexibility and aim for rapid growth. It combines the advantages of private and public hosting, enabling multiple use cases, from quickly deploying additional resources to securely storing sensitive data and testing new products.
21 October 2025 · 3 min to read
Infrastructure

Hypervisor: Types, Examples, Security, Comparison

A hypervisor is a process that helps separate the operating system and running applications from the hardware component. This typically refers to specialized software. However, embedded hypervisors also exist. These are available from the start, rather than being launched after system deployment. The hypervisor is what enables the development of the virtualization concept. Hardware virtualization is the ability to manage multiple virtual machines (VMs) on a single device. They become guest systems. An example of virtualization in use is renting a virtual server from a hosting provider. Multiple isolated spaces are located on one device. Different software can be installed on them. This increases resource utilization efficiency. Memory, computing power, and bandwidth are distributed among virtual servers rather than sitting idle waiting for load. Virtualization is not limited to servers. Storage hypervisors use it for data storage. They run on physical hardware as VMs, within the system, or in another storage network. Hypervisors also help virtualize desktops and individual applications. History of the Hypervisor Virtualization began being used in the 1960s. For the most part, the virtualization environment was applied to IBM mainframes. Developers used it to test ideas and to study and refine hardware concepts. This made it possible to deploy systems and fix errors without threats to the stability of the primary equipment. At the beginning of the new millennium, virtualization received a powerful boost thanks to widespread adoption in Unix family operating systems. There were several reasons for mass distribution: Server hardware capabilities improved. Architecture refinement led to increased reliability and security. Developers began implementing hardware virtualization on processors based on x86 architecture. This led to mass adoption. Since then, virtualization systems have been used not only for solving complex engineering tasks, but also for simple resource sharing and even home entertainment. In recent years, virtualization has expanded beyond x86 to ARM-based processors, with solutions like Apple's Virtualization framework and AWS Graviton instances becoming increasingly common. Advantages of Hypervisors Although virtual machines run on a single device, logical boundaries are built between them. This isolation protects against threats. If one virtual machine fails, others continue to operate. Another huge advantage is mobility. VMs are independent of hardware. Want to migrate an environment to another server? No problem. Need to deploy a VM on a local computer? Also a simple task. Less connection to hardware means fewer dependencies. Finally, resource savings. A hosting provider manages equipment more rationally by providing one physical server to multiple clients. Machines don't sit idle, but bring benefit with all their capabilities. Clients don't overpay for physical equipment while simultaneously gaining the ability to scale quickly and conveniently if such a need arises. Types of Hypervisors There are two types of hypervisors, concisely named Type 1 and Type 2. TYPE 1: bare-metal hypervisors. They run on the computer's hardware. From there, they manage the equipment and guest systems. This type of virtualization is offered by Xen, Microsoft Hyper-V, Oracle VM Server, and VMware ESXi. Modern cloud providers also use specialized Type 1 hypervisors like AWS Nitro and KVM-based solutions. TYPE 2: hosted hypervisors. They operate within the system as regular programs. Virtual systems in this case appear in the main system as processes. Examples include VirtualBox, VMware Workstation, VMware Player, and Parallels Desktop. To increase the stability, security, and performance of hypervisors, developers combine features of both types, creating hybrid solutions. They work both on "bare metal" and using the host's main system. Examples include recent versions of Xen and Hyper-V. The boundaries between bare-metal and hosted hypervisors are gradually blurring. However, it's still possible to determine the type. Though there's usually no practical need for this. Hypervisor Comparison Virtualization types are not the only difference. Hypervisors solve different tasks, have different hardware requirements, and have licensing peculiarities. Hyper-V A free hypervisor for servers running Windows OS. Its features: No graphical interface; configuration and debugging must be done in the console. Licenses must be purchased for all VMs running Windows. No technical support, although updates are released regularly. Hyper-V uses encryption to protect virtual machines and also allows reducing and expanding disk space. Among the disadvantages: there's no USB Redirection needed for connecting USB devices to virtual hosts. Instead, Discrete Device Assignment is used, which is not a complete replacement. VMware VMware is a virtualization technology created by the American company of the same name. It's used to organize virtual server operations. In 2024, Broadcom acquired VMware and introduced significant changes to licensing models and product portfolios, shifting focus toward larger enterprise customers. Many know about ESXi, a hardware hypervisor built on a lightweight Linux kernel called VMkernel. It contains all the necessary virtualization tools. A license must be purchased for each physical processor to operate. The amount of RAM and how many virtual machines you plan to run on your equipment doesn't matter. Note that under Broadcom's ownership, licensing models have evolved, with many standalone products being bundled into subscription packages. VMware has free virtualization tools. However, their capabilities are insufficient for professional use. For example, the API works in read-only mode, and the number of vCPUs must not exceed eight. Additionally, there are no backup management tools.  VMware Workstation The VMware Workstation hypervisor was created in 1999. Now it's a virtualization tool for x86-64 computers with Windows and Linux. The hypervisor supports over two hundred guest operating systems. VMware Hypervisor has a free version with reduced functionality, typically used for familiarization and testing. In 2024, Broadcom made VMware Workstation Pro free for personal use, making it more accessible to individual users and developers. KVM An open-source tool designed for Linux/x86-based servers. Intel-VT and AMD-V extensions are also supported, and ARM virtualization extensions are increasingly common. The KVM hypervisor is quite popular. It's used in many network projects: financial services, transportation systems, and even in the government sector. KVM is integrated into the Linux kernel, so it runs quickly. Major cloud providers use KVM as the foundation for their virtualization infrastructure. However, some disadvantages remain. Built-in services are not comparable in functionality to other hypervisors' solutions. To add capabilities, third-party solutions must be used, such as SolusVM or more modern management platforms like Proxmox VE. KVM is being refined by a community of independent developers, so gradually there are fewer shortcomings in its operation. The quality of the hypervisor is confirmed by hosting providers who choose it for virtualization on their equipment. Xen Xen is a cross-platform hypervisor solution that supports hardware virtualization and paravirtualization. It features minimal code volume. Modules are used to expand functionality. Open source code allows any specialist to modify Xen for their needs. Oracle VM VirtualBox Oracle VM VirtualBox is a cross-platform hypervisor for Windows, Linux, macOS, and other systems.  It is one of the most popular hypervisors, especially in the mass market segment. This is partly because VM VirtualBox has open source code. The program is distributed under the GNU GPL license. A distinctive feature: VirtualBox offers broad compatibility across different host and guest operating system combinations, making it ideal for development and testing environments. Hypervisors vs. Containers Hypervisors are often contrasted with containers. They allow deploying a greater number of applications on a single device. You already know what a hypervisor is and how it works. The problem is that VMs consume many resources. To operate, you need to make a copy of the operating system, plus a complete copy of the equipment for this system to function. If you allocate a nominal 4 GB of RAM to a VM, then the main device will have 4 GB less RAM. Unlike VMs, a container only uses the operating system's resources. It also needs power to run a specific application. But much less is required than to run an entire OS. However, containers cannot completely replace VMs. This is partly due to the increased risk of losing all data. Containers are located inside the operating system. If the host is attacked, all containers can be damaged or lost. A virtualization server creates multiple virtual machines. They don't interact with each other; there are clear boundaries between them. If one machine is attacked, the others remain safe. Along with all their contents. In modern infrastructure, containers and VMs are often used together. Container orchestration platforms like Kubernetes typically run on virtual machines, combining the isolation benefits of VMs with the efficiency of containers. This hybrid approach has become the standard for cloud-native applications. Security Issues Hypervisors are more secure than containers. However, they still have problems. Theoretically, it's possible to create a rootkit and malicious application that installs itself disguised as a hypervisor. Such a hack is called hyperjacking. It's difficult to detect. Protection doesn't trigger because the malicious software is already installed and intercepts system actions. The system continues to work, and the user doesn't even suspect there are problems. To protect the system from rootkits, specialists are developing various approaches that protect it without negatively affecting performance. Modern processors include hardware-based security features like Intel TXT and AMD Secure Encrypted Virtualization to help prevent hypervisor-level attacks. How to Choose a Hypervisor The choice is vast: VMware or VirtualBox, Hyper-V or KVM. There's one universal recommendation: focus on the tasks. If you need to test an operating system in a virtual machine on a home computer, VirtualBox will suffice. If you're looking for a solution to organize a corporate-level server network, then the focus shifts toward VMware tools (keeping in mind recent licensing changes), KVM-based solutions like Proxmox, or cloud-native options. For cloud deployments, consider managed hypervisor solutions from providers like Hostman, AWS, Azure, or Google Cloud, which abstract away much of the complexity while providing enterprise-grade performance and security.
20 October 2025 · 9 min to read
Infrastructure

Information Security (InfoSec): Definition, Principles Triad, and Threats

Information security refers to various methods of protecting information from outsiders. That is, from everyone who should not have access to it. For example, a marketer typically has no reason to view the company's financial statements, and an accountant doesn't need to see internal documents from the development department. Before the era of universal digitization, it was mainly paper documents that needed protection. They were hidden in safes, secret messages were encrypted, and information was transmitted through trusted people. Today, computer security is the foundation of any business. InfoSec Principles Information security protection is based on three principles: availability, integrity, and confidentiality. Confidentiality: data is received only by those who have the right to it. For example, application mockups are stored in Figma, with access limited to designers and the product manager. Integrity: data is stored in full and is not changed without permission from authorized persons. Suppose there's code in a private repository. If an unauthorized person gains access to the repository and deletes part of the project, this violates integrity. Availability: if an employee has the right to access information, they receive it. For example, every employee can access their email. But if the email service is attacked and made unavailable, employees won't be able to use it. Adhering to these principles helps achieve the goal of information security: to reduce the likelihood of or eliminate unauthorized access, modification, distribution, and deletion of data.  Many companies also adopt a zero-trust security approach that assumes no user or system should be trusted by default. This reinforces all three principles by requiring continuous verification. What Information Needs Protection Understanding what data should be protected is what information security in a company depends on. Information can be publicly accessible or confidential. Publicly accessible: this data can be viewed by anyone. Confidential: available only to specific users. At first glance, it seems that information security measures don't apply to publicly accessible information, but this isn't true. Only the principle of confidentiality doesn't apply to it. Publicly accessible data must remain integral and, logically, available. For example, a user's page on a social network. It contains publicly accessible information. The social network ensures its availability and integrity. If the user hasn't changed privacy settings, anyone can view their page. But they cannot change anything on it. At the same time, the account owner can configure confidentiality, for instance, hide their friends, groups they're subscribed to, and musical interests. Confidential information also comes in different types. These can be: Personal user data. Trade secrets: information about how the company operates and what projects it conducts and how. Professional secrets, which must be kept by doctors, lawyers, notaries, and representatives of certain other professions. Official secrets: for example, pension fund data, tax inspection information, banking details. State secrets: intelligence information, data on economic conditions, foreign policy, science and technology. This is not an exhaustive list, but rather an attempt to show how much data needs information security measures applied to it. Possible Threats The enormous list of potential threats is usually divided into four types: Natural: for example, hurricanes or floods. Man-made: phenomena related to human activity. They can be unintentional (employee error) or intentional (hacker attack). Internal: threats that originate from within the system, such as from employees. External: threats that originate from other sources, such as attacks by competitors. With the mass adoption of remote work formats, the number of man-made threats, both external and internal, intentional and unintentional, has noticeably increased. Because of this, the workload on information security specialists has grown. Today's threat environment includes several increasingly prevalent attack vectors: Ransomware attacks: malicious software that encrypts company data and demands payment for its release. These attacks have become more sophisticated and targeted, often crippling entire organizations. Supply chain attacks: compromising software or hardware providers to gain access to their customers' systems. Attackers exploit trust relationships between organizations and their vendors. AI-powered threats: artificial intelligence is being used to create more convincing phishing campaigns, generate deepfakes for social engineering attacks, and automate vulnerability discovery. At the same time, AI is also being deployed defensively to detect and respond to threats faster. Social engineering and deepfakes: attackers use AI-generated audio and video to impersonate executives or trusted individuals, making fraudulent requests appear legitimate. Protection Measures Organizational information protection measures are implemented at several control levels. Administrative: the formation of standards, procedures, and protection principles. For example, developing a corporate security policy. At this level, it's important to understand what data you will protect and how. Logical: protection of access to software and information systems. At this control level, access rights are configured, passwords are set, and secure networks and firewalls are configured. Physical: at this level, physical infrastructure is controlled. This refers not only to access to equipment, but also to protection from fires, floods, and other emergency situations. Despite digitization, physical information protection remains no less important. Antivirus software and access rights separation won't help if attackers gain physical access to the server. They won't save you in case of an emergency either. To eliminate such problems, Hostman uses infrastructure in protected data centers.
20 October 2025 · 5 min to read

Do you have questions,
comments, or concerns?

Our professionals are available to assist you at any moment,
whether you need help or are just unsure of where to start.
Email us
Hostman's Support