Home DOCKER
Post
Cancel

DOCKER

What Is Docker?

Docker is a powerful tool that allows developers to develop, package, and deploy applications efficiently. It is a container management service that was released in 2013 and is open-source and available for different platforms like Windows, macOS, and Linux. Docker helps to reduce the delay between writing code and running it in production by quickly shipping, testing, and deploying code.

With Docker, you can create self-contained environments known as containers that can run consistently on different platforms. To get started with Docker, you need to install the Docker engine on your computer or device. The Docker engine is responsible for creating and managing Docker containers, Docker images, Docker hub, Docker desktop, and more.

In this Docker tutorial, you will learn all the basic to advanced concepts like Docker installation, Docker container, Docker commands, Docker run, Docker images, Docker compose, Docker engine, Docker networking, and more. By the end of this tutorial, you will have a solid understanding of how to use Docker to develop and deploy applications efficiently.

Why to learn Docker?

Firstly Docker helps to develop, package, and deploy applications more efficiently, reducing costs and resources. It allows developers to build applications in containers, which are lightweight and self-contained environments that can run consistently on different platforms.

Secondly Docker provides consistency in application development and deployment. By using containers, developers can ensure that the application runs the same way in different environments, eliminating the “it works on my machine” problem.

Thirdly Docker provides portability, allowing applications to be easily moved from one environment to another. This makes it easier to deploy applications across different infrastructures and clouds.

Fourthly Docker provides security by isolating applications in containers, reducing the attack surface and limiting the impact of any potential security breaches.

Lastly Docker provides version control, allowing developers to track changes to the application and its dependencies over time. This makes it easier to roll back to previous versions if necessary.

Overall, Docker is a powerful tool that provides several benefits to developers, making it a popular choice for developing and deploying applications efficiently.

Features of Docker

  • reduces the size of development by providing a smaller part of the OS via containers.
  • It is easier to work on the same project by different teams with the help of Containers.
  • Docker containers can be deployed anywhere, on any physical, or virtual machines and on the cloud.
  • Docker containers are lightweight so, it becomes east to scale them.

Advantages of Docker

  • Docker uses less memory compared to traditional virtual machines because it shares the host kernel and uses minimal resources.

  • The full operating system is not required to run an application in a Docker container. This makes the application more lightweight and easier to manage.

  • Containers run faster than traditional virtual machines because they do not require a hypervisor and can share the host kernel.

  • Docker is lightweight and easy to use, making it easy to develop, test, and deploy applications.

  • Docker allows us to use a remote repository, such as Docker Hub, to share containers with other teams. This makes it easy to collaborate and share resources across different teams.

  • Docker reduces the risks associated with application dependencies by isolating the application and its dependencies in a container. This ensures that the application runs consistently across different environments and reduces the risk of conflicts with other applications or dependencies.

Disadvantages of Docker

  • Layering can increase complexity, but it also provides flexibility and modularity. Docker’s layering approach allows for efficient use of disk space and faster container creation times. However, it is important to manage the layers carefully to avoid unnecessary complexity.

  • Managing a large number of containers can be challenging, but there are tools available to help with this. Docker provides container orchestration tools like Docker Compose, Docker Swarm, and Kubernetes that help manage large numbers of containers.

  • Docker is not designed for applications that require better graphics performance. Docker containers are optimized for running server-side applications, not graphical user interfaces (GUIs). However, there are workarounds available to run GUI-based applications in Docker containers.

  • Docker provides cross-platform compatibility as long as the host operating system supports Docker. Docker containers can run on Windows, macOS, and Linux hosts. However, some applications may require specific hardware or operating system dependencies that may not be available on all platforms.

How Does Docker Work?

Docker works via a Docker engine that is composed of two key elements: a server and a client; and the communication between the two is via REST API.

Components of Docker

There are four components that we will discuss in this getting started with docker tutorial:

  • Docker client and server
  • Docker image
  • Docker registry
  • Docker container

Docker Container

A Docker container is a lightweight and executable package of software. It includes everything used to run an application, code, libraries, and dependencies.

Docker Client and Server

Docker Client and Server is a command-line-instructed solution that allows users to issue commands from the terminal on their Mac or Linux system to the Docker daemon.

Docker Image

The Docker image is built within the YAML file and hosted as a file in the Docker registry. It has four layers of instructions: From, Pull, Run and CMD.

Docker Registry

Docker Registry is a platform for storing and sharing Docker images. It can be used by connecting to the publicly available Docker Hub registry or by creating a private registry for internal use. The push and pull commands are used to interact with the registry. The push command is used to upload a new container environment from a local manager node to the Docker registry, while the pull command is used to download new Docker images created from the Docker registry. Using the push command, you can easily share your Docker images with others and ensure that everyone is working with the same environment.

Docker Desktop

Docker Engine is the client-server technology that is used to build and run containers. It is a fundamental component of Docker and provides the necessary tools to create and manage containers. Docker Desktop includes Docker Engine as one of its components.

Docker Desktop is a convenient application that bundles together numerous Docker resources, making it easy for developers to build and deploy containerized applications and microservices. It provides a streamlined workflow for developers to create, test, and deploy applications using Docker.

Install Docker Desktop on Windows

To install Docker Desktop, follow these steps:

  • Double-click on the Docker Desktop Installer.exe file to run the installer. If you haven’t downloaded the installer yet, you can get it from Docker Hub. The installer typically downloads to your Downloads folder, or you can run it from the recent downloads bar at the bottom of your web browser.

  • When prompted, select the “Use WSL 2 instead of Hyper-V” option on the Configuration page if it’s available and depending on your choice of backend. If your system only supports one of the two options, you won’t be able to select which backend to use.

  • Follow the instructions on the installation wizard to authorize the installer and proceed with the installation process.

  • Once the installation is complete, click on the “Close” button to finish the installation process.

  • If your admin account is different from your user account, you must add the user to the docker-users group. To do this, run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.

Reference

  • https://www.tutorialspoint.com/evolution-of-docker-from-linux-containers

  • https://www.devzero.io/blog/is-docker-compose-the-right-tool-for-your-production-environment

  • https://dataconomy.com/2023/03/21/what-is-containers-as-a-service-caas/

1
Hopefully this article has provided inspiration, understanding, and encouragement to do better. Thank you for reading.
This post is licensed under CC BY 4.0 by the author.
Trending Tags