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

Centos7.6 Docker offline yum source

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Set up the yum source repository

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

Use Ali Cloud Docker Yum source

Yum-config-manager-- add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

After the creation is completed, execute the following command to empty and re-establish the yum cache to see if the creation is successful.

Yum makecache fast

Yum clean all

Yum makecache

Yum repolist

List and sort which versions are in the repository. Here are examples, from high to low.

Yum list docker-ce-- showduplicates | sort-r

Install the specified version

Yum install docker-ce-18.06.2.ce

Uninstall the historical version

Yum remove docker\

Docker-client\

Docker-client-latest\

Docker-common\

Docker-latest\

Docker-latest-logrotate\

Docker-logrotate\

Docker-selinux\

Docker-engine-selinux\

Docker-engine

Open the yum source retention installation package

Vim / etc/yum.conf

Keepcache=0

Modified to:

Keepcache=1

Use createrepo to add a local directory as an yum source

Yum-y install createrepo

Mkdir-pv / app/yum/docker/

The yum source rpm copy / app/yum/docker/ directory will be downloaded

Cd / var/cache/yum/x86_64/7

Cp docker-ce-stable/packages/ / app/yum/docker/

Cp base/packages/ / app/yum/docker/

Cp extras/packages* / app/yum/docker/

Use createrepo to add the local directory as the yum source, and some files will be automatically created in this directory

Createrepo / app/yum/docker/

Create docker installation source files

Vim docker.repo

[docker]

Name=docker

Baseurl= file:///app/yum/docker/

Enabled=1

Gpgcheck=0

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Centos-7

Execute the command to see if docker-ce can query the

Yum list docker-ce

Yum-y install docker-ce

Set up startup Docker

Systemctl enable docker

Systemctl start docker

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

Servers

Wechat

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

12
Report