Home >Operation and Maintenance >Docker >Why is docker written in go language?

Why is docker written in go language?

青灯夜游
青灯夜游Original
2020-07-17 13:28:105369browse

First of all, our current mainstream services all use Unix/Linux operating systems, and Golang relies very little on third parties. This is both a limitation and an advantage. In this case, Docker developed using Golang can basically run perfectly on most servers equipped with Unix/Linux operating systems.

Why is docker written in go language?

Why does Docker not require Golang to be installed?

The question why Docker does not need to be installed is because I am a Java background developer, and some open source tools developed in Python are used on Ubuntu, and both Java and Python open source tools require Install the corresponding operating environment:

Java requires at least JRE to be installed, and sometimes JDK is also installed for convenience

Python requires at least the Python development environment to be installed, and sometimes open source tools also need to install other Python. Third-party package

Take Java as an example. The Java source program is compiled by the compiler and becomes bytecode. The bytecode is interpreted and executed by the virtual machine. The virtual machine sends each bytecode to be executed to The interpreter translates it into machine code on a specific machine and then runs it on the specific machine. Both the compiler and the interpreter are actually part of the JVM. Java's platform independence is actually achieved by JVM, and Java programs also need to run on JVM.

But Golang compiles and generates a static executable file with no other external dependencies except glibc.

So what is glibc?

In fact, glibc is the libc library released by GNU, which is the c runtime library. Glibc is the lowest-level API in the Linux system, and almost any other running library depends on glibc. This also means that docker can actually run without Golang on Unix/Linux systems.

Why did Docker choose to use Golang for development?

First of all, our current mainstream services all use Unix/Linux operating systems, and as described earlier, Golang has very little dependence on third parties (only glibc) , which is both a limitation and an advantage. Because in this case, Docker developed using Golang can basically run perfectly on most servers installed with Unix/Linux operating systems.

Recommended tutorials: "docker tutorial", "PHP tutorial"

The above is the detailed content of Why is docker written in go language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn