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

The method of installing Docker under cnetos7 and what are the common commands of docker

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

Share

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

This article mainly explains "the method of installing Docker under cnetos7 and what are the common commands of docker". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn "the method of installing Docker under cnetos7 and what are the common commands of docker"!

1: install Docker directly using yum

Yum install docker

2: test whether the installation is successful:

# enter the command docker-v to check whether docker is successfully installed docker-v

3. Start the docker process

# start dockersystemctl start docker#, restart dockersystemctl restart docker#, stop docker service systemctl stop docker# to check whether the current docker starts ps-A | grep docker

Summary of commands commonly used in 4.docker:

# list all local images, and then add grep filtering query, such as docker images | grep mysqldocker images# finds relevant images on Docker Hub. For example, you need to check mysql-related images docker search mysql# to list all local container information docker ps-a # Delete local images docker rmi images ID# delete local containers docker rm container ID# get images from docker hub For example, to get the mysql5.6 image # is actually going to https://hub.docker.com/ to obtain the mysql image, and the tag is that 5.6docker pull mysql:5.6# uses the image to start (run) a container #-I keep the container's standard input open #-t assign a terminal to the docker and bind it to the container's standard input #-d let the container backend run #-p container port and native port mapping The first port is the native port, and the second is the container port #-v the native directory is mounted to the container directory docker run-d-p 127.0.0.1 docker exec 3306 it 3306 mysql:5.6# into a container terminal running in the background, it container ID / bin/bash# starts the stopped container docker start container ID# stops the container docker stop container ID# restarts a container docker restart container ID to this I believe that you have a deeper understanding of "the method of installing Docker under cnetos7 and what are the common commands of docker". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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