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

Installation commands for docker containers

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces the knowledge of "docker Container installation Command". 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!

Execute the command to install docker first

Execute sudo apt-get update update package

Execute sudo apt-get-y install docker.io to install docker

Enter docker version to check whether docker is installed successfully

The use of docker

Docker-help to check the help information, general software will have this command, do not say any more.

Docker version looks at the version of docker.

Docker info looks at the basic information of docker, how many containers, images and so on.

Docker images looks at all the images on this machine.

Currently, there is no image on my machine, which is shown as follows:

Docker pull: [tag name]: pull the image. By default, the tag name is not written and the latest image is pulled.

We enter docker pull hello-world to pull the latest hello-world image.

Docker run: run an image and it becomes a container, which is equivalent to new and an Image. Next we run the image on run hello-world.

Now that the hello-world of our docker is running successfully, start a nginx server to access the nginx in our container from the outside. Similarly, we first pull the nginx image docker pull nginx, and then wait for the pull to complete, run the nginx container, docker run-p 8080 docker run 80 nginx

Then we use our own browser to access port 8080, and the presence of welcom to nginx indicates that the startup is successful.

This is the end of the "docker Container installation Command". Thank you for 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

Servers

Wechat

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

12
Report