Home > Operation and Maintenance > Docker > What are the docker base images?

What are the docker base images?

青灯夜游
Release: 2021-12-30 17:12:31
Original
6285 people have browsed it

Basic images include: 1. Application images (nginx, redis, mongo, mysql, httpd, php, tomcat, etc.); 2. Programming language images (node, oraclejdk, openjdk, python, golang, etc.); 3 , blank image "scratch".

What are the docker base images?

The operating environment of this tutorial: linux5.9.8 system, docker-1.13.1 version, Dell G3 computer.

What is the Docker base image?

We usually use an image as the basis and customize it. This is the base image.

It’s like running a nginx image container and then making modifications. The base image must be specified in DockerFile (FROM is to specify the base image, so FROM is a necessary instruction in a Dockerfile and must be the first instruction)

For example, to build a Java application image, select It is more convenient to use an Oracle JDK image as the base image than to choose an alpine image as the base image.

What are the Docker base images?

There are many high-quality official images on Docker Hub. You can find the one that best meets our final needs. The target image is customized for the base image.

There are application images, such as nginx, redis, mongo, mysql, httpd, php, tomcat, etc.;

has programming languages ​​that are convenient for developing, building, and running applications in various languages. Mirror, such as node, oraclejdk, openjdk, python, ruby, golang wait.

There are also more basic operating system images, such as ubuntu, debian, centos, Fedora, alpine, etc., the software libraries of these operating systems provide us with broader expansion space.

In addition to selecting an existing image as the base image, Docker also has a special image named scratch. This image is a virtual concept and does not actually exist. It represents a blank image.

If you use scratch as the base image in DockerFIle (FROM scratch), it means that you are not based on any image. The instructions written next It will start to exist as the first layer of the image. It is not uncommon to directly copy executable files into images without being based on any system, such as swarm, coreos/etcd. For statically compiled programs under Linux, there is no need for an operating system to provide runtime support. All required libraries are already in the executable file, so directly FROM scratch will make the image size larger. Compact. Many applications developed using the Go language will use this method to create images, which is one of the reasons why some people think that Go is a language that is particularly suitable for container microservice architecture.

Recommended learning: "

docker video tutorial"

The above is the detailed content of What are the docker base images?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template