In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
I believe many inexperienced people don't know what to do about how to install and configure Docker in Centos7. Therefore, this article summarizes the causes and solutions of the problem. I hope you can solve this problem through this article.
First, install docker
1. View system version
# View linux system version lsb_release-a # installation of docker in CentOS7 requires the system to be 64-bit and the system kernel version 3.10 or above uname-r
2. Install with yum source
The foreign sources brought with CentOS are sometimes very slow, so we replace them with domestic Ali sources.
# Advanced source directory cd / etccd yum.repos.d/
# back up the official source mv CentOS-Base.repo CentOS-Base.repo.bak
# download the Ali source file to wget-O / etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# rebuild the source data cache yum makecache
Ok, source change completed
# one click to install yum-y install docker
3. Run docker
# check the installation list yum list installed | grep docker
# add it in {} using Docker China Accelerator vi / etc/docker/daemon.json#. After adding: {"registry-mirrors": ["https://registry.docker-cn.com"]," live-restore ": true} # View docker version docker version
# set boot systemctl enable docker
# start dockersystemctl start docker
# View status systemctl status docker
4.dokcer common commands
Docker start container name or container ID-container startup
Docker stop container name or container ID-close the container
Docker pull [options] name [: tag]-pull image, specified version of tag
Docker images-View the list of images
Docker run [options] image [: tag].. -run in the foreground and can be terminated using ctr+c
Docker run-d image-run in the background to print an ID
Docker ps-View running images
Docker exec-it image bash-enter the container
Id / bin/bash of image initiated by docker exec-it
Docker stop $(docker ps-a-Q)-stop all containers
Docker rm $(docker ps-a-Q)-Delete all containers
Systemctl restart docker-docker restart
Docker logs-f-- tail=100-View the last 100 lines of the log
Delete the mirror:
1. First delete the stopped instance
Find stopped instances: docker ps-a
Delete stopped instance: docker rm instance id
two。 Then delete the image in images
View image: docker images
Delete Mirror: docker rmi name
After reading the above, have you mastered how to install and configure Docker in Centos7? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.