Zhang Da fat Docker road

The development of the environment

Zhang big fat wish to jump to the new company's R & D department, he gearing up, ready to show their talents.

In accordance with the practice of entry, the allocation of a local development environment is essential. Excitedly see the group leader sent the configuration documents, not only suck a cold lump: even as many as dozens of pages!

A closer look, a full 48 steps, my gods!

Group of old people to the new people cast a pity of the eyes, many of them mixed with schadenfreude, seems to think of my early entry when the environment that miserable time.

Big fat to do a deep breath, set the gods, officially began the process of suffering.

From the SVN to download the code to solve the compiler error, Hey, how the lack of so many jar file?

Well-known old beam quickly said: I sent the jar file to you, that configuration document is too old, no two years updated.

Big fat heart sigh, but he is very careful, while the configuration environment, but also modify the document side.

He determined to engage in a new version of the out: from the beginning, the back of the new no longer have to be tortured.

But how easy it is, easy to delete the jar file is also easy to set up Build Path after they have to commit to SVN, the next time someone to download, compile the dependency is automatically resolved.

The other is a bit of trouble, install Nginx, Tomcat, MySQL, Redis … … which is not fuel-efficient lights, the choice of installation path, configuration file changes, port settings, and finally have to link them up.

After nine hundred eighty-one difficult, and finally to the final step of the document: run.

But it is expected that the console a lot of error message shocking, seems to laugh at every new incompetence.

Big fat hearts of ten thousand beasts Pentium, and he felt a strong sense of helplessness.

Old Liang sitting that high – end programmers dedicated chair slipped over: "how? Taste bad it, do you want me to help you?

Zhang fat can say anything, veteran, a top two

But this time the old driver also rollover, the old beam toss for a long time, full of Han, there is always a run-time error can not solve.

Near noon, the old beam said: forget, go to fill his stomach it

Big fat afternoon to keep full of energy, the morning to install the system to delete, re-come again, sample, do not believe I am uncertain about you.

3 hours passed, to the time of operation, or the same mistake.

The next day again, or the same mistake! Is it a matter of character? Originally wanted to show their talents, to show their deep programming skills, did not expect in this small gutter has been out of the.

The third day, big fat simply put the machine formatted, see success or failure, life heroic, but is from scratch again.

This time the old beam is also staring next to the pair configuration, each configuration command has been carefully checked 100 times, at noon, big fat tears to see: the system can finally run up!

Configure once and run everywhere

All the pit was found, and all the pit was filled.

Zhang fat also fell into the thought: this process is too painful, how can we improve it?

So many steps, so many configurations, if all done in advance, take it directly with the good!

Big fat Lingji a move: the configuration of these Tomcat, MySQL, Redis … … and the flow of a virtual machine not get it? Newcomers, and directly download a configured virtual machine, out of the box, no longer care about so much in the long-winded details.

Zhang fat is a hard worker, immediately roll up the sleeve experiment, but the results are not satisfactory. One is too much virtual machine, the second is to die slowly, which have drank 3 cups of coffee has not started finished.

An accidental opportunity to hear my colleagues chatting Docker, simply read the relevant information, he immediately think, since the virtual machine so cumbersome, why not use the lightweight Docker to solve the problem?
f6d725238db75ae6db3e811f03b298db.jpg

And the same virtual machine, the Tomcat, MySQL, Redis these software first configured to form a project-specific docker mirror, anyone just get this mirror can be used to run up with the Docker engine to form a container, external services.

Zhang fat quickly try a bit, it really is lightweight, running like lightning in general, got up and poured tea to start the effort.

Old beams are very grateful to the spirit of this hard work, the introduction of the popular technology into the project, both to learn new technology, but also improve the production efficiency, serve two purposes, win-win situation.

Old beam volunteered to do the first test users, but also abnormal smooth, really Build Once, Run Anyware ah, so Docker slowly in the project group popular.

Stability overrides everything

In the weekly meeting of the project, Zhang fat and put forward a new idea: "Since we have started to use Docker development, and can not test environment and even the production environment are also changed to Docker? Since then the deployment of the application is very convenient, Directly run the mirror up. "

Development team who have agreed, think about the future only need to put a mirror into the production environment can be deployed, and how beautiful prospects ah.

But is responsible for the operation and maintenance of Pharaoh said: "This is not necessary? Three years ago we have to put the production environment to take a good, has been no change, you say those local configuration problems in the production environment on the fundamental Does not exist, why use Docker this new technology? Ruined the production environment who is responsible?

It seems that Pharaoh is very contradictory ah, Zhang big fat to think, but no wonder, the production environment, stability overrides everything.

Think about it, the production environment are configured, and now upgrade the application is nothing more than the web code, the database sql handed over to Pharaoh to perform, in most cases, or automation, change the configuration of the opportunity is very few, the necessity is not too Big.

But Pharaoh is very enlightened, he went on to say: "You are not engaged in a new project, you can take it to try ah, development, testing, production all with Docker, if it is a smooth transition, that We will be pushed by the future. "

Old beam said: "Yes, the new technology to try, come slowly."

Although there is no way to fight the production environment also use Docker, but Zhang fat on the Docker is more and more like, he also found another advantage of Docker, that is, you can easily try new technology.

Originally wanted to toss a new thing, in the case of dependence, particularly troublesome, a packet of a package download, if encountered by the wall, it is not want to live. Now only need to download a new technology / new tool with the mirror, you can run up, it is too considerate!

Not only that, once a customer request to demonstrate the development of new projects, in accordance with the requirements of the project manager in the past, engage in a demo system that is available, but now only need to copy the mirror to the project manager, you can directly use , Is really convenient.

Build once, run anyware, Zhang fat is considered to be.

[Postscript] This article is mainly about Docker's application scenario: to simplify the environment configuration, Docker there are many other advantages, such as Docker and micro-service is a pair of good friends, interested students can take a look.

In addition, when you try to introduce a new technology to the project, be sure to look at the new technology can solve any problems, give the project team what value, so more likely to succeed.

Original link: Zhang Docker Taipan's Way (Author: Liu Xin)

    Heads up! This alert needs your attention, but it's not super important.