Get the App
SLTechnology News&Howtos  ›  Development  › 

How to install and use Docker under Linux

Shulou Source: shulou.com Published: 2022-06-02 18:52:39 11月03日 Update

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.

Tags: Containers mirrors articles more references applications running good practical each other between content accelerators at the same time commands commonly used developers engines interfaces articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia macOS Shulou Tech Info Xiaomi