Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Docker getting started installation tutorial (small white article)

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Dokcer introduction:

Docker is a container-related technology. To put it simply, you can think of it as a miniature stand-alone system in which you run all kinds of software, and then run the system on a linux server or on a computer. This system is called a Docker container, and the machine running a Docker container is called a host. The characteristics of Docker enable it to be ported and run in different environments intact, which avoids the BUG caused by the same code due to subtle differences in various environments on the server, and Docker is easy to operate and easy to use.

Application scenarios of Docker

Automated packaging and distribution of Web applications. Automated testing and continuous integration and release. Deploy and adjust databases or other background applications in a service-oriented environment. Build your own PaaS environment by compiling or extending existing OpenShift or Cloud Foundry platforms from scratch.

Advantages of Docker

1. Simplify the procedure:

Docker allows developers to package their applications and dependency packages into a portable container and publish them to any popular Linux machine for virtualization. Docker has changed the way it is virtualized, allowing developers to manage their work directly in Docker. Convenience and rapidity is already the biggest advantage of Docker. In the past, tasks that took days or even weeks could be completed in seconds under the Docker container.

2. Avoid choice phobia:

If you have choice phobia, you are a senior patient. Docker helps you pack up your entanglements! For example, Docker image; Docker image contains the running environment and configuration, so Docker can simplify the deployment of multiple application instances. For example, Web applications, background applications, database applications, big data applications such as Hadoop cluster, message queue and so on can be packaged into a mirror deployment.

3. Save money:

On the one hand, with the advent of the era of cloud computing, developers do not have to configure high hardware in order to pursue results, and Docker has changed the mindset of high performance and high price. The combination of Docker and cloud makes the cloud space 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

Clients corresponding to different systems are provided on the official website of Docker to operate Docker containers.

Docker Mirror

Image is the most important part of Docker. We mentioned above that Docker can run in different environments to ensure the consistency of containers. This is because each Docker container is created based on Docker image, just like when we install a system using an image. How can the system installed by the same image be different? For this reason, as long as the Docker container is generated based on the same Docker image, it must be the same environment, and then we can run the Docker container on any different host, so it ensures that the code or application will not cause different BUG for different environments.

Registry

It is specially used to store various images. We can use Docker Hub as a public repository, or we can build our own private repository, just like using Github.

Docker container

As mentioned above, what is actually running on the host is the Docker container, which is generated based on the Docker image. Installation of Docker:

Docker supports Linux, mac and Windows systems. During the installation process, you can check the official Docker documentation or search for other tutorials. You need some Linux basics. Note that the Docker CE,Docker EE we installed is for the business model. All the examples below in this article are operated using the CentOS 7 system.

1. Check whether the configuration meets the conditions

Under CentOS, Docker must ensure that the kernel version is above 3.8. you can check it using uname-a. You can see that the kernel version 3.10 has met the requirements.

2. Install Device Mapper to provide storage capacity for Docker

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

3. Set the warehouse address for downloading Docker CE

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

4. Install the Docker client

Sudo yum install docker-ce

5. Check whether Docker is installed successfully

We can type sudo docker-- version to view the Docker version. If the version number is displayed successfully, the installation is successful. Here, you can add docker to the user group, so you don't have to type sudo every time.

6. Start Docker

# start Dockersudo service docker start# in daemon mode and set boot to start Dockersystemctl start docker automatically

7. Configure Docker image acceleration

Because Docker's site is abroad, it will be slow to do some network operations, we can configure Docker's mirror accelerator, here we use Ali's mirror accelerator. We can execute the command according to the following operation document.

Or you can directly create a daemon.json file and put it in the / etc/docker directory as follows.

After restarting Dokcer, you can use the docker info command to view the information of the Docker client, and you can see that the configured image acceleration does work.

Summary:

This article introduces the concept and use 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 also introduce some other installation methods. You can try it. The next article will introduce the basic use of Docker.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report