Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to test the Docker version

2025-03-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to test the Docker version". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Related concepts of Docker

Docker is a platform for developers and operators to develop, publish, and run applications in containers. Deploying an application using a Linux container is called containerization. Container is not a new concept, its advantage is that it is easy to release an application.

Containerization has become very popular because it has the following advantages:

Flexibility: even the most complex applications can be containerized.

Lightweight: the container maximizes the use and sharing of the host kernel.

Interchangeable: you can deploy updates and upgrades in real time.

Convenience: you can build applications locally, deploy them to the container cloud, and run them anywhere.

Scalable: you can increase and automatically distribute the number of containers.

Stackable: you can stack services vertically and instantly.

Mirrors and containers

The container is started by running an image. An image is an executable package that contains everything you need to run the application-code, runtime libraries, environment variables, and configuration files.

The container is a run-time instance of a mirror, and the container is an image running in memory (that is, a mirror has a state, or a user process). You can view a series of running containers by tapping a docker ps like the linux environment.

Containers and virtual machines

One container runs locally in the linux service and shares the host's kernel with other containers. It runs in a separate process, and the container takes up less memory and is more lightweight than other executable processes (such as virtual machines).

By contrast, a virtual machine (VM) runs a complete "guest" operating system that virtually accesses host resources through the hypervisor. In general, virtual machines provide an environment that requires more resources than most applications.

Prepare your Docker environment

To install docker, please see the official website.

Centos installation:

Yum-y install docker-io

Start:

Service docker start

For more system installation, please see the official website.

Test the Docker version

Run the docker-version command and make sure that the version of Dokcer you installed supports the change command:

Docker-- versionDocker version 17.12.0-ce, build c97c6d6

Run the docker info (docker version does not have -) command to see more docker installation information.

Docker infoContainers: 0 Running: 0 Paused: 0 Stopped: 0Images: 0Server Version: 17.12.0-ceStorage Driver: overlay2... Test docker installation successfully

Run a simple docker image (hello world) to test that the docker installation is successful.

Docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-worldca4f61b1923c: Pull completeDigest: sha256:ca0eeb6fb05351dfc8759c20733c91def84cb8007aa89a5bf606bc8b315b9fc7Status: Downloaded newer image for hello-world:latestHello from docking this message shows that your installation appears to be working correctly....

two。 List the hello world images downloaded on your machine.

Docker image ls

Lists the exited hello-world containers (generated by mirrors). If it is still running, the-all option is not required:

Docker container ls-allCONTAINER ID IMAGE COMMAND CREATED STATUS54f4984ed6a8 hello-world "/ hello" 20 seconds ago Exited (0) 19 seconds ago Command Review # # List Docker CLI commandsdockerdocker container-help## Display Docker version and infodocker-versiondocker versiondocker info## Execute Docker imagedocker run hello-world## List Docker imagesdocker image ls## List Docker containers (running, all All in quiet mode) docker container lsdocker container ls-- alldocker container ls-aq "how to test the Docker version" ends here Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report