Docker Getting Started Installation Tutorial (Beginner Edition)

Docker Getting Started Installation Tutorial (Beginner Edition)

Doccer Introduction:

Docker is a container-related technology. Simply put, you can think of it as a miniature independent system in which you can run various software, and then run this system on a Linux server or computer. This system is called a Docker container, and the machine that runs the Docker container is called a host machine. The characteristics of Docker enable it to be ported and run in different environments intact, which avoids bugs caused by subtle differences in the same code on the server. In addition, Docker is simple to operate and easy to use.

Application scenarios of Docker

  • Automatic packaging and publishing of web applications.
  • Automated testing and continuous integration and release.
  • Deploy and tune databases or other backend applications in a service-oriented environment.
  • Compile from scratch or extend the existing OpenShift or Cloud Foundry platform to build your own PaaS environment.

Advantages of Docker

1. Simplify the procedures:
Docker allows developers to package their applications and dependent packages into a portable container and then publish it to any popular Linux machine to achieve virtualization. Docker has changed the way virtualization is done, allowing developers to directly put their own results into Docker for management. Convenience and speed are already the biggest advantages of Docker. Tasks that used to take days or even weeks can now be completed in seconds using Docker containers.

2. Avoid choice phobia:
If you have a fear of making choices, you are a veteran patient. Docker helps you package your entanglement! For example, Docker images contain the operating environment and configuration, so Docker can simplify the deployment of multiple application instances. For example, Web applications, backend applications, database applications, big data applications such as Hadoop clusters, message queues, etc. can all be packaged into a mirror image for deployment.

3. Save money:
On the one hand, the advent of the cloud computing era means that developers no longer need to configure expensive hardware in pursuit of results. Docker has changed the mindset that high performance must come at a high price. The combination of Docker and the cloud allows cloud space to be more fully utilized. It not only solves the problem of hardware management, but also changes the way of virtualization.

Docker components:

Docker Client and Server

Docker's official website provides clients corresponding to various systems for operating Docker containers.

Docker images

Mirroring is the most important part of Docker. As mentioned above, Docker can ensure the consistency of containers when running in different environments. This is because each Docker container is created based on a Docker image. Just like when we install a system, we need to use a mirror. How can the systems installed with the same image be different? It is for this reason that as long as the Docker container generated based on the same Docker image must be exactly the same environment, then we can run this Docker container on any different host machines, thus ensuring that the code or application will not cause different bugs due to different environments.

Registry

A warehouse dedicated to storing various images. We can use the public warehouse Docker Hub, or we can build our own private warehouse, just like using Github.

Docker Containers

As mentioned above, what actually runs on the host machine are Docker containers, which are generated based on Docker images. Docker Installation:

Docker supports Linux, Mac and Windows systems. For the installation process, you can check the official Docker documentation or search for other tutorials. Some Linux basics are required. Note that we installed Docker CE, Docker EE is for commercial use. All the examples below in this article are operated using the CentOS 7 system.

1. Check whether the configuration meets the requirements

In CentOS, Docker must ensure that the kernel version is above 3.8. You can use uname -a to check and you can see that the kernel version is 3.10, which meets the requirements.

2. Install Device Mapper to provide storage capabilities for Docker

sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2

3. Set the repository address for downloading Docker CE

sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

4. Install Docker client

sudo yum install docker-ce

5. Check whether Docker is installed successfully

We can enter sudo docker --version to view the Docker version. If the version number is successfully displayed, it means that the installation is successful. Here we can add docker to the user group, so there is no need to enter sudo every time.

6. Start Docker

#Start Docker in daemon mode
sudo service docker start
#Set Docker to start automatically at boot
systemctl start docker

7. Configure Docker image acceleration

Because Docker's site is located overseas, some network operations will be slow. We can configure Docker's image accelerator. Here we use Alibaba's image accelerator. We can execute commands according to the following operation documents.

Or you can directly create a daemon.json file and put it in the /etc/docker directory with the following content, which can achieve the same purpose.


After restarting Docker, you can use the docker info command to view the information of the Docker client, and you can see that the configured image acceleration is indeed working.

Summarize:

This article introduces the concept and purpose of Docker, and demonstrates how to install Docker. Here is the installation tutorial on the official website. Some books about Docker or other Docker tutorials will introduce some other installation methods. You can try them. The next article will introduce the basic use of Docker.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Docker installation and simple usage tutorial
  • Docker simple installation and application introductory tutorial
  • What is Docker? Docker Getting Started Tutorial Part 1
  • Docker Learning Notes: Getting Started with Docker
  • Docker Getting Started Quick Start Guide
  • Two-hour introductory Docker tutorial
  • Introduction to Docker containers
  • Docker container from entry to obsession (recommended)

<<:  MySQL 5.7.18 version free installation configuration tutorial

>>:  Add and delete table information using javascript

Recommend

MySQL Optimization Summary - Total Number of Query Entries

1. COUNT(*) and COUNT(COL) COUNT(*) usually perfo...

Implementation of crawler Scrapy image created by dockerfile based on alpine

1. Download the alpine image [root@DockerBrian ~]...

MySQL 5.6 binary installation process under Linux

1.1 Download the binary installation package wget...

JavaScript Sandbox Exploration

Table of contents 1. Scenario 2. Basic functions ...

Vue multi-page configuration details

Table of contents 1. The difference between multi...

Unicode signature BOM (Byte Order Mark) issue for UTF-8 files

I recently encountered a strange thing when debug...

vue dynamic component

Table of contents 1. Component 2. keep-alive 2.1 ...

Vue parent component calls child component function implementation

Vue parent component calls the function of the ch...

Briefly describe the difference between Redis and MySQL

We know that MySQL is a persistent storage, store...

Docker Swarm from deployment to basic operations

About Docker Swarm Docker Swarm consists of two p...

How to output Chinese characters in Linux kernel

You can easily input Chinese and get Chinese outp...

Detailed explanation of Nginx static file service configuration and optimization

Root directory and index file The root directive ...

Several ways to introduce pictures in react projects

The img tag introduces the image Because react ac...