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 install and use Docker under Linux

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

Share

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

This article will explain in detail how to install and use Docker under Linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Docker is the most popular open source application container engine that allows developers to package their applications and dependency packages into a portable image, publish them to any popular Linux machine, and virtualize them. Containers are fully sandboxed and will not have any interface with each other.

Install docker in Linux environment

1. Install dependencies

Sudo yum install-y yum-utils device-mapper-persistent-data lvm2

two。 Set the mirror source (e. G. Ali cloud mirror source)

Sudo yum-config-manager-- add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3. Install Docker-CE

Sudo yum install docker-ce

4. Set up self-boot and start Docker-CE

Sudo systemctl enable dockersudo systemctl start docker

Note: docker is installed here, and you can set up user permissions for docker. At the same time, you can also set accelerator configuration containers and images. You can also refer to the official website, or default, which is temporarily omitted here.

The basic use of common commands in docker

1. Pull the image

Docker pull

two。 Delete Mirror

Docker rmi image identification

3. View all mirrors

Docker images

4. Start and stop the specified container

Docker start # launch Container docker stop # Startup Container

5. View container log

Docker logs-f

6. View running containers and all containers, including stopped

Docker ps # running docker ps-a # all

7. Delete containers or all containers

When docker rm containers are marked, ID # Delete specified containers docker rm $(docker ps-a-Q) # Delete all containers

8. Enter the container

Docker exec-it container ID / bin/bash this article on "how to install and use Docker under Linux" ends here. I hope the above content can be helpful to you, so that you can learn more knowledge. If you think the article is good, please share it for more people to see.

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

Development

Wechat

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

12
Report