In the past few years, "cloud" has stood among various trendy technologies as a star word. You may have used it, but you can't tell its principle; or you have never used it, but heard its name; You may not even have heard its name, but you must be very familiar with this blue whale. As a technician, as long as you are in the software industry, you must have different degrees of understanding of him.
What is Docker?
Docker's LOGO is very characteristic, a whale carries many containers, and the containers are full of goods to be delivered. The whale is the operating system, and the container is the Docker, and the container is the cargo to be delivered, which is the application. The size, size and shape of various "goods" are different, and they have to be placed on whales. Then, it is necessary to consider how various goods are placed, and whether the goods can be overlapped. So there is the concept of a container, and each piece of goods is put into the container, so that the whales can be placed in an orderly manner, saving time and effort.
Then it can be understood as: the packaged software is placed in the container, and the container is placed in the operating system, which is a simple "build-ship-run", so that you can guarantee how to run on your own computer and on the server. It is also how to run, which greatly reduces the error of program operation due to environmental reasons, and development requires a lot of energy to toss the environment.
As a software containerization platform, Docker allows developers to package an application together with its dependent environment into a container, package the image and upload it to the warehouse, and then publish the application to any platform. When in use, the image can be pulled to the local with only one command, and then the project can be quickly deployed with one command. This also perfectly interprets the three cores of Docker: images, containers, and warehouses.
So, first of all we have to understand the advantages of Docker:
1. Fast
The runtime performance can be greatly improved (the classic case is a 97% improvement).
Management operations (start, stop, start, restart, etc.) are in seconds or milliseconds.
- agile
As agile as a virtual machine, less expensive, and easy to deploy.
- flexible
"Containerize" apps and systems without adding additional operating systems.
- Lightweight
You'll have enough "operating systems" that you just need to add or subtract images. 100 to 1000 Containers can be deployed on a server.
5. Cheap
Open source, free, low cost. Supported and powered by modern Linux kernels. Note* Lightweight Containers can definitely open more "containers" on a physical machine, and are destined to be cheaper than VMs.
- Cloud support
Cloud services provide a framework for creating and managing Linux containers.
In the previous article, we also systematically introduced Docker, and interested students can poke:
Chapter 3: The grievances and grievances between Docker and k8s (3) - The wave of Docker is coming
Chapter 5: The grievances between Docker and k8s (5) - Kubernetes innovation
Chapter 8: The grievances and grievances between Docker and k8s (8) - a look back at Kubernetes
Docker application deployment BI data analysis
Through the above series of introductions, we can understand Docker from the development background to the specific principles and usage. Next, we will take BI data analysis application as an example to introduce how to implement Docker application deployment.
First, let's start with BI data visualization analysis. Through the investigation of many BI applications on the domestic market, it is found that these applications have some problems.
- Depending on the operating environment JDK, JAR, .NET Core, etc., if the operating environment is inconsistent, various problems will occur.
- Installation is complicated. For non-professionals, deploying a system requires a lot of effort.
- Too dependent on the operating system. For example, there will be various system problems such as the unsupportable x32 bit, the difficult configuration of the win7 environment, and the unsupported version of winserver2008.
- There are various application software installed on the PC, which is easy to conflict with the installed software, causing unpredictable abnormal problems.
- Installing various anti-virus software on the PC, such as 360, Kingsoft Internet Security, PC Manager and other anti-virus software, will kill the process and cause some BI services to fail to run normally.
- BI products generally have many running scheduled tasks. After installing the BI application on a personal PC, even if the software is not opened, the program is still running, which may easily cause the PC to run into a lag.
The existence of the above problems allows Docker to highlight its value.
First of all, the container in Docker is isolated from other containers, and the obtained image contains all the dependent operating environments required for Docker to run; therefore, a complete BI application can be installed with just two lines of code. We take the deployment of Wyn Enterprise as an example to demonstrate the specific process of Docker's software deployment.
Example steps:
- Install Docker
- Get the image:
sudo docker pull grapecitycn/wyn-enterprise
- Create and run the docker container:
sudo docker run --name wyn -p 51980:51980 -d grapecitycn/wyn-enterprise
- At this point, we can access Wyn through http://{server\_ip\_address}:51980
Through the above examples, we can see that the deployment of the BI system can be completed quickly with only three simple command lines. Excuse me, is there any easier and faster way to deploy than Docker?
Docker image packaging
The deployment is so simple, so how to do it if you want to port it, and how to publish the integrated project in the Docker repository?
Next, we will answer these two questions for you through the process of de-imaged packaging of a case system.
The cause of the incident was that the customer found the grapes and expressed their desire to package the BI software into their own application system. After implementing the OEM white label processing, after doing some personalized configuration, the image was repackaged and uploaded to the Docker warehouse.
Just do it, let's start the project now.
- First, create your own Docker container using the Docker image provided by Wyn Enterprise
sudo docker pull grapecitycn/wyn-enterprise
sudo docker run --name wyn -p 51980:51980 -d grapecitycn/wyn-enterprise
Use: http://{server\_ip\_address}:51980 for personalized operation configuration.
- Configure the system according to your own requirements
You can configure the system according to your own needs, such as replacing the background image and LOGO of the login page, the LOGO displayed in the upper left corner of the system, and replacing the LOGO displayed on the browser tag page; you can also create some sample documents according to your own needs.
- After logging in to the system with admin, export the documents and configurations you need.
- Make a Docker image
4.1. Prepare a Linux machine and copy the folder custom-wyn to this machine;
4.2. Rename the compressed file exported in step 3 to sample\_files.zip, and copy it to the directory custom-wyn/sample\_files;
4.3. If you need to build fonts in a custom Docker image, please copy the prepared font files to the directory custom-wyn/custom\_fonts;
4.4. Modify the tag name of the docker image wyn-enterprise in the dockerfile file according to your own needs;
4.5. Referring to the content in the script file push-docker-image.sh, create and upload the Docker image to the Docker repository.
4.6. Packaging resources
You can download it from this address:
https://gcdn.grapecity.com.cn/forum.php?mod=viewthread&tid=139206
4.7. Pull the Docker image for verification
Pull the Docker image created in the above steps and use the image to create a docker container.
Access and verify the Wyn Enterprise application running in that docker container.
So far our Docker image has been created.
Summarize
Here, our system introduces the advantages of Docker applications and the whole process of deploying the entire BI project in Docker. Among them, Docker image packaging is also a favorite function in many enterprises. Through simple operation, BI is integrated into its own application system and packaged together, which perfectly solves the problem of embedded integration.
At present, more and more developers have invested in the team of Docker. At the same time, with the update and iteration of technology, BI is also constantly improving. Now Wyn Enterprise has supported K8S cluster deployment. Next, we will continue to share data integration, data analysis, cluster deployment and other content with you.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。