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 configure the docker suite in the CentOS7 virtual machine

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

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "how to install and configure docker suite in CentOS7 virtual machine". Many people will encounter this 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!

1. Open vmware, create a virtual machine, select a CD, and next

two。 Choose traditional bios

3. Custom settin

4. Select the location to store the virtual machine, storage

5. Custom memory is 2g and disk is 40gb

6. Power on, select install centos 7

7. Select language

8. Select disk

9. Set up preinstalled softwar

10. Save memory and turn off kdump

11. Open the network and set the hostname

twelve。 Start installation

13. Set the root user password, create a user with sudo privileges, and set the password settings administrator user

Add a user with sudo permission

Wait for the reading note to be completed.

Restart

Agree to an agreement

Complete the setup

Log in

Start using

Installation succeeded

Adjust time zone

Choose Shanghai

After installation and configuration, enjoy linux.

The advantage of centos does not lie in the graphical interface. If you like linux with graphical interface, deepin and unbuntu are recommended here. If you have high requirements for the beauty of the interface, it is recommended that you try elementaryos, which claims to be the most beautiful linux.

Every time I get a brand new centos image, the first thing to do is to change the domestic source for centos and add a new yum source. Complain that the default yum source does not support commonly used software. For example, I want to install a python-pip. Sorry, no!

But fortunately, centos also leaves some leeway, you are free to add some of your favorite sources, such as epel (extra packages for enterprise linux)

The Enterprise linux add-on package (hereinafter referred to as epel) is a fedora special interest group to create, maintain, and manage a high-quality add-on package set for Enterprise linux, including, but not limited to, Red Hat Enterprise linux (rhel), centos, scientific linux (sl), oracle linux (ol). Epel packages usually do not conflict with packages in the official source of the enterprise version of linux or replace files with each other. The epel project is basically the same as fedora, including the complete build system, upgrade manager, image manager, and so on.

Step 1: replace

1.1 backing up old yum sources

Sudo mv / etc/yum.repos.d/centos-base.repo / etc/yum.repos.d/centos-base.repo.bak

1.2 write the following to / etc/yum.repos.d/centos-base.repo

# centos-base.repo## the mirror system uses the connecting ip address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for centos updates# unless you are manually picking other mirrors.## if the mirrorlist= does not work for you As a fall back you can try the# remarked out baseurl= line instead.## [base] name=centos-$releasever-basebaseurl= https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7#released updates [updates] name=centos-$releasever-updatesbaseurl= https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/#mirrorlist=http:/ / mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey= file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7#additional packages that may be usefull [extras] name=centos-$releasever-extrasbaseurl= https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7#additional packages that extend functionality of existing packages [centosplus] Name=centos-$releasever-plusbaseurl= https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-7

1.3 refresh the yum source

Yum clean all & & yum makecache & & yum update

But yum source software is still too little, for example, I want to install only python-pip can't do it.

Step 2: install Ali epel source

Yum-y install epel-releasewget-o / etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo# Refresh yum Source yum clean all & & yum makecache & & yum update

At this point, we can happily install python-pip, yum install python-pip

Step 3: install docker and docker-compose

1. Install docker

# install dockersudo yum-y install docker# through the yum source to start dockersudo systemctl start docker# boot self-starting sudo systemctl enable docker

two。 Install docker-compose

Check sudo docker-compose-- version after sudo pip install docker-compose# installation is successful

3. Docker China's official image acceleration

Modify / etc/docker/daemon.json to add the following configuration

{"registry-mirrors": ["https://registry.docker-cn.com"]}"

Restart docker

This is the end of sudo service docker restart's "how to install and configure docker Suite in CentOS7 Virtual Machine". 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

Internet Technology

Wechat

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

12
Report