After the launch of wechat cloud hosting, many students showed great curiosity, but were deterred by their lack of understanding of concepts such as Docker, image and container.

This article from a simple point of view, lead you to quickly understand the essential knowledge of wechat cloud hosting, and then the cloud hosting can help the business to do what, what to use the arrangement!

What is a Docker?

Whether you don’t remember it, or just haven’t heard of it before, it’s time to catch up! It’s a basic point. It’s a test.

Docker is an application container engine developed by GO language. It is an application deployment technology based on containerization and sandbox mechanism. To put it bluntly, Docker is a powerful tool.

Since it is a tool, it must follow orders. Instructions are the basis for us to operate it correctly, which can be achieved in three ways:

  1. Docker command
  2. Dockerfile script (recommended by wechat cloud hosting)
  3. A shell script

So, what exactly can Docker do?

First, it will put your project and the basic image into a project image according to the command, and then create a container in wechat cloud hosting/server, let the image run inside the container, so as to realize the deployment of the project. That is:

Command -> Mirror

(Project + base image) + Docker = Project Image

Wechat cloud hosting/server -> container

Project image + Container = Project deployment

Correct use of Docker, the ideal effect is: developers only need to provide the code of the project, through Docker can build and configure everything needed for your project running environment. In short, if you can master the Docker tool, you can play the image and container very smoothly.

The first is a mirror image and the second is a container, which we will expand on later.

What is a mirror image?

This is a concept that has been around since the birth of computers. For example, the ISO installation disk of Windows system is actually a form of image. Image is a heap of storage that is solidified and not running, but always keeps running logic.

When the image into the running environment, such as operating system ISO installed into a notebook, there is a running instance, notebook computing performance is stronger, play a greater role.

As mentioned above, Docker generates images according to instructions, and then generates running container instances according to the images.

Docker is a good master of image construction, and knows the principle that everyone brings fire to the fire: When Docker builds an image, it can rely on a parent image as the bottom image to package together, so as to build a brand new image. The parent image that is used as a dependency is the base image.

Therefore, before configuring the project Dockerfile to create the image script, you need to establish a base image.

For example, the image above introduces the basic image of Node, which has the resources we need to run node.js.

The place where the underlying image exists is called a repository, similar to the repository our code hosts or the NPM repository.

The repository contains images of various operating environment systems and framework languages to meet the requirements of various projects. For example, if you want to run a Python project, you need to import python-related images into the repository. Of course, you can also create your own image for your own use, Docker as a tool is also easy to do.

What is a container?

Let’s start again with Docker: After Docker generates container instances based on images, the container becomes an operational entity, which can sense its existence and vitality through a series of means.

The process from image to container is similar to class creating an object, and Windows and other operating systems are installed on a computer.

Most likely many developers have the experience of maintaining the server: to a server system has been debugged software and network hit a mirror, save a disk, and then directly install and load the disk on other servers, you can not go again “start to play strange” the old way.

Docker images are similar to self-typed images in the server. The difference lies in that self-typed images are run in the server or split into small virtual machines. Docker images need to run in a “sandbox” environment, which relies on containerization technology.

In summary, a container is an image running in a specific environment and the external whole.

To explain further, a container is an isolated environment for processes built by three techniques:

  • Linux Namespace and Linux Cgroups, the heart of containerization technology, provide runtime isolation and resource granting.
  • Rootfs, or images, provide the running content of the container.

What is the difference between container and server?

In the process of the rapid development of the Internet, the development of the server in the form has never stopped. Let’s vividly explain the development history of the server form and even cloud computing through an example of “family housing demand” :

  1. Own physical construction (own server entity) : at the beginning, we are engaged in several servers for their own maintenance, usually a power failure on the kind of complete.

Example: You build your own villa and manage the property

  1. Physical hosting (managed server entity) : to maintain and inspect the entity of things, the cost is very high, so there are service providers to help hosting, find a quality place.

For example: You build a villa and hire someone to manage it

  1. IaaS infrastructure as a service: If there is demand, there will be a lease. If you can’t afford a server, you can buy server resources from a service provider. Cloud computing is taking shape.

Example: no money to build their own villa, rich to buy a small high-rise, their own decoration

  1. PaaS platform as a service: I don’t care about the server, I need to handle the server OS and software, just give me a resource that can run the project.

For example: buy a small high-rise or a room, fine decoration carry bags to stay

  1. FaaS function-as-a-service: a core feature you don’t want to do, import a service provided by someone else, and then write something to do it yourself.

Example: someone in the home is more selective, want a good feng shui, first arrange to live in a hotel

  1. SaaS software as a service: I don’t even want to write code, but I can introduce software to do that.

Example: The whole family stays in a hotel

Until now, cloud vendors have been exploring how to provide more popular resources. The above states have never disappeared, each of which has its own special preference of users, users care about the appeal point is different, determines the user in that state level.

Containerization technology and the emergence of Docker are actually aimed at improving the disadvantages of server maintenance in IaaS, such as inconsistent operating environment and cumbersome network configuration. Although targeted operation and maintenance tools can reduce such pressure, some costs will be paid more or less.

Container technology, in essence, is to lay a platform on the server system, directly control and manage the bottom computing and storage resources, the upper layer isolated from the running environment for the developer’s project image to run.

It’s like a company that buys a big factory, divides up a lot of smaller rooms, connects each room to water and electricity, and then harmonizes some standards and rents them out.

So, from a developer’s perspective, if you don’t have to worry about the server running, there are only two things to focus on:

  1. Packaging of project images;
  2. Defines how to manage delimited containers and process resources.

What are the differences and connections between cloud hosting and container services?

With the advent of container choreography technology and tools, the server is directly turned into an operable module. Developers only need to operate the control panel to direct the steps of server containerization, which truly achieve unified management.

Because of unified containerization, there is no need to worry about server operating environment differences and network configuration. It gives you a remote control that can be used to create a lot of containers and then pay for the resources you actually use.

But not all developers are comfortable with container layout, configuration, etc. It’s like driving a driver’s license.

So, what if I don’t know how to drive, but I want to go out in the car?

“Surrogate driving” came into being.

Analogy to the technical level, WeChat cloud hosting not only provide rental services (container services), also provide “driving” service: developers need only simple configuration, put forward the purpose and demands of WeChat cloud hosting will automatically create and maintain your container instance plan, also equipped with many advanced industry technology system, ensure that you can use the latest and most mainstream solutions and technology. The conclusion:

Container services + + commonly used database automatically enlarge shrinks capacity + operations ancillary services (monitor, log and alarm) + cloud ecological + WeChat + X (more) in capacity development = WeChat cloud hosting https://cloud.weixin.qq.com/

Wechat cloud hosting preferential support

7 discount

For all users of wechat cloud hosting, 30% discount will be offered under pay-as-you-go mode until December 31, 2021.

Ten thousand yuan enterprise incentive plan

Wechat cloud hosting launched enterprise incentive plan, ten thousand yuan subsidy, expert-level migration service, Tencent cloud official traffic exposure, etc., to help enterprises enjoy the ultimate experience of cloud native at a lower cost.

Low cost Resource Pack (coming soon)

For individual developers and new enterprise users, wechat cloud hosting will launch resource packages of different gradients to further reduce product costs.