scenario

The last article was mainly to solve the problem of offline installation of Intranet Docker. The main method is to install by RPM, but there is still a lack of dependency package, step by step download upload installation is too troublesome, so we have to mount through Intranet image, yum installation to solve the dependency package problem, if it is sure that there is no lack of dependency package, the last article can be carried out RPM offline installation

operation

  1. Copy the image to the server

I used the full version, (for example centos-7-x86_64-DVD-1908. iso) in /home/centos7/iso /

  1. Create a mount path and mount it
The mkdir/media/Centos mount -o loop / / home/Centos7 / iso/Centos - 6.9 - x86_64 - bin - DVD1. Iso/media/CentosCopy the code
  1. View mounting information
df -Th
Copy the code
  1. Modify/etc/yum. Repos. D

Copy the repo from the original path to the new folder.

 cd /etc/yum.repos.d
 mkdir  bak
 mv *.repo  bak/
Copy the code
  1. The local image source file local.repo is added
vi local.repo
Copy the code

Enter the following file and save it

[local_server] name=this is a local repo baseurl=file:///media/Centos Priority =1 ## gpgkey=file:///media/ RPm-gpG-KEY-centos-7Copy the code
  1. Perform clear local cache & Rebuild local cache
yum clean all
yum makecache all
Copy the code
  1. To view
yum repolist
Copy the code

8. Upload the docker installation package and install it through yum

yum  -y localinstall *.rpm
Copy the code

Note: The difference between RPM installation and YUM installation is that RPM does not download dependencies, but yum does. Ensure that the installation environment does not have other dependencies, and you can use RPM to install

  1. Start the
systemctl start docker
Copy the code

If error ‘inotify add watch failed’ is displayed, enter ‘journalctl -xe’ to check the error message

level=info msg="devmapper: Creating filesystem xfs on device docker-253:1-34265854-base, mkfs args: [-m crc=0,finobt=0 /dev/mapper/docker-253:1-34265854-base]"
level=info msg="devmapper: Error while creating filesystem xfs on device docker-253:1-34265854-base: exit status 1"
Copy the code

10. Check the MKFS version (default file system of CentOS7)

mkfs.xfs -V
Copy the code

The MKFS version is too early. Upgrade the version

yum -y update xfsprogs
Copy the code

11. Restart docker

systemctl start docker
Copy the code