[root@localhost ~]# vi /etc/yum.repos.d/docker.repo
[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror
Repository 'docker' is missing name in configuration, using id
Determining fastest mirrors

  • base: ftp.sjtu.edu.cn
  • extras: ftp.sjtu.edu.cn
  • updates: mirrors.ustc.edu.cn
    base | 3.6 kB 00:00
    docker | 3.5 kB 00:00
    extras | 2.9 kB 00:00
    updates | 2.9 kB 00:00
    (1/4): docker/updateinfo | 55 B 00:00
    (2/4): docker/primary_db | 93 kB 00:00
    (3/4): extras/7/x86_64/primary_db | 249 kB 00:00
    Repository 'docker' is missing name in configuration, using id18 MB 00:01 ETA
    (4/4): updates/7/x86_64/primary_db | 19 MB 00:17
    repo id repo name status
    base/7/x86_64 CentOS-7 - Base 10,072
    docker docker 199
    extras/7/x86_64 CentOS-7 - Extras 515
    updates/7/x86_64 CentOS-7 - Updates 4,691
    repolist: 15,477
    [root@localhost ~]# Repository 'docker' is missing name in configuration, using id
    -bash: Repository: command not found
    [root@localhost ~]# yum -y install docker-ce
    Loaded plugins: fastestmirror
    Repository 'docker' is missing name in configuration, using id
    Loading mirror speeds from cached hostfile
  • base: ftp.sjtu.edu.cn
  • extras: ftp.sjtu.edu.cn
  • updates: mirrors.ustc.edu.cn
    Resolving Dependencies
    --> Running transaction check
    ---> Package docker-ce.x86_64 3:20.10.23-3.el7 will be installed
    --> Processing Dependency: container-selinux >= 2:2.74 for package: 3:docker-ce-20.10.23-3.el7.x86_64
    --> Processing Dependency: containerd.io >= 1.4.1 for package: 3:docker-ce-20.10.23-3.el7.x86_64
    --> Processing Dependency: docker-ce-cli for package: 3:docker-ce-20.10.23-3.el7.x86_64
    --> Processing Dependency: docker-ce-rootless-extras for package: 3:docker-ce-20.10.23-3.el7.x86_64
    --> Processing Dependency: libcgroup for package: 3:docker-ce-20.10.23-3.el7.x86_64
    --> Running transaction check
    ---> Package container-selinux.noarch 2:2.119.2-1.911c772.el7_8 will be installed
    --> Processing Dependency: policycoreutils-python for package: 2:container-selinux-2.119.2-1.911c772.el7_8.noarch
    ---> Package containerd.io.x86_64 0:1.6.16-3.1.el7 will be installed
    ---> Package docker-ce-cli.x86_64 1:20.10.23-3.el7 will be installed
    --> Processing Dependency: docker-scan-plugin(x86-64) for package: 1:docker-ce-cli-20.10.23-3.el7.x86_64
    ---> Package docker-ce-rootless-extras.x86_64 0:20.10.23-3.el7 will be installed
    --> Processing Dependency: fuse-overlayfs >= 0.7 for package: docker-ce-rootless-extras-20.10.23-3.el7.x86_64
    --> Processing Dependency: slirp4netns >= 0.4 for package: docker-ce-rootless-extras-20.10.23-3.el7.x86_64
    ---> Package libcgroup.x86_64 0:0.41-21.el7 will be installed
    --> Running transaction check
    ---> Package docker-scan-plugin.x86_64 0:0.23.0-3.el7 will be installed
    ---> Package fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 will be installed
    --> Processing Dependency: libfuse3.so.3(FUSE_3.2)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
    --> Processing Dependency: libfuse3.so.3(FUSE_3.0)(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
    --> Processing Dependency: libfuse3.so.3()(64bit) for package: fuse-overlayfs-0.7.2-6.el7_8.x86_64
    ---> Package policycoreutils-python.x86_64 0:2.5-34.el7 will be installed
    --> Processing Dependency: policycoreutils = 2.5-34.el7 for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: setools-libs >= 3.3.8-4 for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: libsemanage-python >= 2.5-14 for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: audit-libs-python >= 2.1.3-4 for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: libqpol.so.1(VERS_1.4)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: libqpol.so.1(VERS_1.2)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: libapol.so.4(VERS_4.0)(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: libqpol.so.1()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
    --> Processing Dependency: libapol.so.4()(64bit) for package: policycoreutils-python-2.5-34.el7.x86_64
    ---> Package slirp4netns.x86_64 0:0.4.3-4.el7_8 will be installed
    --> Running transaction check
    ---> Package audit-libs-python.x86_64 0:2.8.5-4.el7 will be installed
    --> Processing Dependency: audit-libs(x86-64) = 2.8.5-4.el7 for package: audit-libs-python-2.8.5-4.el7.x86_64
    ---> Package checkpolicy.x86_64 0:2.5-8.el7 will be installed
    ---> Package fuse3-libs.x86_64 0:3.6.1-4.el7 will be installed
    ---> Package libsemanage-python.x86_64 0:2.5-14.el7 will be installed
    ---> Package policycoreutils.x86_64 0:2.5-29.el7 will be updated
    ---> Package policycoreutils.x86_64 0:2.5-34.el7 will be an update
    ---> Package python-IPy.noarch 0:0.75-6.el7 will be installed
    ---> Package setools-libs.x86_64 0:3.3.8-4.el7 will be installed
    --> Running transaction check
    ---> Package audit-libs.x86_64 0:2.8.4-4.el7 will be updated
    --> Processing Dependency: audit-libs(x86-64) = 2.8.4-4.el7 for package: audit-2.8.4-4.el7.x86_64
    ---> Package audit-libs.x86_64 0:2.8.5-4.el7 will be an update
    --> Running transaction check
    ---> Package audit.x86_64 0:2.8.4-4.el7 will be updated
    ---> Package audit.x86_64 0:2.8.5-4.el7 will be an update
    --> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository
Size

Installing:
docker-ce x86_64 3:20.10.23-3.el7 docker 22 M
Installing for dependencies:
audit-libs-python x86_64 2.8.5-4.el7 base 76 k
checkpolicy x86_64 2.5-8.el7 base 295 k
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k
containerd.io x86_64 1.6.16-3.1.el7 docker 33 M
docker-ce-cli x86_64 1:20.10.23-3.el7 docker 30 M
docker-ce-rootless-extras x86_64 20.10.23-3.el7 docker 8.5 M
docker-scan-plugin x86_64 0.23.0-3.el7 docker 3.8 M
fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 k
fuse3-libs x86_64 3.6.1-4.el7 extras 82 k
libcgroup x86_64 0.41-21.el7 base 66 k
libsemanage-python x86_64 2.5-14.el7 base 113 k
policycoreutils-python x86_64 2.5-34.el7 base 457 k
python-IPy noarch 0.75-6.el7 base 32 k
setools-libs x86_64 3.3.8-4.el7 base 620 k
slirp4netns x86_64 0.4.3-4.el7_8 extras 81 k
Updating for dependencies:
audit x86_64 2.8.5-4.el7 base 256 k
audit-libs x86_64 2.8.5-4.el7 base 102 k
policycoreutils x86_64 2.5-34.el7 base 917 k

Transaction Summary

Install 1 Package (+15 Dependent packages)
Upgrade ( 3 Dependent packages)

Total download size: 100 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/19): container-selinux-2.119.2-1.911c772.el7_8.noarch.r | 40 kB 00:00
(2/19): audit-libs-python-2.8.5-4.el7.x86_64.rpm | 76 kB 00:00
(3/19): audit-libs-2.8.5-4.el7.x86_64.rpm | 102 kB 00:00
(4/19): checkpolicy-2.5-8.el7.x86_64.rpm | 295 kB 00:01
(5/19): audit-2.8.5-4.el7.x86_64.rpm | 256 kB 00:01
(6/19): docker-ce-20.10.23-3.el7.x86_64.rpm | 22 MB 00:39
(7/19): containerd.io-1.6.16-3.1.el7.x86_64.rpm | 33 MB 00:59
(8/19): docker-ce-rootless-extras-20.10.23-3.el7.x86_64.rp | 8.5 MB 00:15
(9/19): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00
(10/19): libcgroup-0.41-21.el7.x86_64.rpm | 66 kB 00:00
(11/19): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00
(12/19): libsemanage-python-2.5-14.el7.x86_64.rpm | 113 kB 00:02
(13/19): policycoreutils-python-2.5-34.el7.x86_64.rpm | 457 kB 00:02
(14/19): python-IPy-0.75-6.el7.noarch.rpm | 32 kB 00:01
(15/19): policycoreutils-2.5-34.el7.x86_64.rpm | 917 kB 00:04
(16/19): setools-libs-3.3.8-4.el7.x86_64.rpm | 620 kB 00:02
(17/19): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:02
(18/19): docker-scan-plugin-0.23.0-3.el7.x86_64.rpm | 3.8 MB 00:09
(19/19): docker-ce-cli-20.10.23-3.el7.x86_64.rpm | 30 MB 00:49

Total 1.1 MB/s | 100 MB 01:30
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : audit-libs-2.8.5-4.el7.x86_64 1/22
Updating : policycoreutils-2.5-34.el7.x86_64 2/22
Installing : libcgroup-0.41-21.el7.x86_64 3/22
Installing : audit-libs-python-2.8.5-4.el7.x86_64 4/22
Installing : slirp4netns-0.4.3-4.el7_8.x86_64 5/22
Installing : libsemanage-python-2.5-14.el7.x86_64 6/22
Installing : docker-scan-plugin-0.23.0-3.el7.x86_64 7/22
Installing : 1:docker-ce-cli-20.10.23-3.el7.x86_64 8/22
Installing : setools-libs-3.3.8-4.el7.x86_64 9/22
Installing : python-IPy-0.75-6.el7.noarch 10/22
Installing : checkpolicy-2.5-8.el7.x86_64 11/22
Installing : policycoreutils-python-2.5-34.el7.x86_64 12/22
Installing : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 13/22
Installing : containerd.io-1.6.16-3.1.el7.x86_64 14/22
Installing : fuse3-libs-3.6.1-4.el7.x86_64 15/22
Installing : fuse-overlayfs-0.7.2-6.el7_8.x86_64 16/22
Installing : 3:docker-ce-20.10.23-3.el7.x86_64 17/22
Installing : docker-ce-rootless-extras-20.10.23-3.el7.x86_64 18/22
Updating : audit-2.8.5-4.el7.x86_64 19/22
Cleanup : audit-2.8.4-4.el7.x86_64 20/22
Cleanup : policycoreutils-2.5-29.el7.x86_64 21/22
Cleanup : audit-libs-2.8.4-4.el7.x86_64 22/22
Verifying : fuse-overlayfs-0.7.2-6.el7_8.x86_64 1/22
Verifying : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 2/22
Verifying : fuse3-libs-3.6.1-4.el7.x86_64 3/22
Verifying : audit-libs-2.8.5-4.el7.x86_64 4/22
Verifying : checkpolicy-2.5-8.el7.x86_64 5/22
Verifying : policycoreutils-2.5-34.el7.x86_64 6/22
Verifying : python-IPy-0.75-6.el7.noarch 7/22
Verifying : docker-ce-rootless-extras-20.10.23-3.el7.x86_64 8/22
Verifying : policycoreutils-python-2.5-34.el7.x86_64 9/22
Verifying : containerd.io-1.6.16-3.1.el7.x86_64 10/22
Verifying : setools-libs-3.3.8-4.el7.x86_64 11/22
Verifying : docker-scan-plugin-0.23.0-3.el7.x86_64 12/22
Verifying : audit-2.8.5-4.el7.x86_64 13/22
Verifying : libsemanage-python-2.5-14.el7.x86_64 14/22
Verifying : 1:docker-ce-cli-20.10.23-3.el7.x86_64 15/22
Verifying : slirp4netns-0.4.3-4.el7_8.x86_64 16/22
Verifying : audit-libs-python-2.8.5-4.el7.x86_64 17/22
Verifying : 3:docker-ce-20.10.23-3.el7.x86_64 18/22
Verifying : libcgroup-0.41-21.el7.x86_64 19/22
Verifying : audit-libs-2.8.4-4.el7.x86_64 20/22
Verifying : audit-2.8.4-4.el7.x86_64 21/22
Verifying : policycoreutils-2.5-29.el7.x86_64 22/22

Installed:
docker-ce.x86_64 3:20.10.23-3.el7

Dependency Installed:
audit-libs-python.x86_64 0:2.8.5-4.el7
checkpolicy.x86_64 0:2.5-8.el7
container-selinux.noarch 2:2.119.2-1.911c772.el7_8
containerd.io.x86_64 0:1.6.16-3.1.el7
docker-ce-cli.x86_64 1:20.10.23-3.el7
docker-ce-rootless-extras.x86_64 0:20.10.23-3.el7
docker-scan-plugin.x86_64 0:0.23.0-3.el7
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8
fuse3-libs.x86_64 0:3.6.1-4.el7
libcgroup.x86_64 0:0.41-21.el7
libsemanage-python.x86_64 0:2.5-14.el7
policycoreutils-python.x86_64 0:2.5-34.el7
python-IPy.noarch 0:0.75-6.el7
setools-libs.x86_64 0:3.3.8-4.el7
slirp4netns.x86_64 0:0.4.3-4.el7_8

Dependency Updated:
audit.x86_64 0:2.8.5-4.el7 audit-libs.x86_64 0:2.8.5-4.el7
policycoreutils.x86_64 0:2.5-34.el7

Complete!
[root@localhost ~]#

[root@localhost ~]# systemctl start docker
[root@localhost ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]#

[root@localhost ~]# yum -y install conntrack
Loaded plugins: fastestmirror
Repository 'docker' is missing name in configuration, using id
Loading mirror speeds from cached hostfile

  • base: ftp.sjtu.edu.cn
  • extras: ftp.sjtu.edu.cn
  • updates: mirrors.ustc.edu.cn
    Resolving Dependencies
    --> Running transaction check
    ---> Package conntrack-tools.x86_64 0:1.4.4-7.el7 will be installed
    --> Processing Dependency: libnetfilter_cttimeout.so.1(LIBNETFILTER_CTTIMEOUT_1.1)(64bit) for package: conntrack-tools-1.4.4-7.el7.x86_64
    --> Processing Dependency: libnetfilter_cttimeout.so.1(LIBNETFILTER_CTTIMEOUT_1.0)(64bit) for package: conntrack-tools-1.4.4-7.el7.x86_64
    --> Processing Dependency: libnetfilter_cthelper.so.0(LIBNETFILTER_CTHELPER_1.0)(64bit) for package: conntrack-tools-1.4.4-7.el7.x86_64
    --> Processing Dependency: libnetfilter_queue.so.1()(64bit) for package: conntrack-tools-1.4.4-7.el7.x86_64
    --> Processing Dependency: libnetfilter_cttimeout.so.1()(64bit) for package: conntrack-tools-1.4.4-7.el7.x86_64
    --> Processing Dependency: libnetfilter_cthelper.so.0()(64bit) for package: conntrack-tools-1.4.4-7.el7.x86_64
    --> Running transaction check
    ---> Package libnetfilter_cthelper.x86_64 0:1.0.0-11.el7 will be installed
    ---> Package libnetfilter_cttimeout.x86_64 0:1.0.0-7.el7 will be installed
    ---> Package libnetfilter_queue.x86_64 0:1.0.2-2.el7_2 will be installed
    --> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size

Installing:
conntrack-tools x86_64 1.4.4-7.el7 base 187 k
Installing for dependencies:
libnetfilter_cthelper x86_64 1.0.0-11.el7 base 18 k
libnetfilter_cttimeout x86_64 1.0.0-7.el7 base 18 k
libnetfilter_queue x86_64 1.0.2-2.el7_2 base 23 k

Transaction Summary

Install 1 Package (+3 Dependent packages)

Total download size: 245 k
Installed size: 668 k
Downloading packages:
(1/4): libnetfilter_queue-1.0.2-2.el7_2.x86_64.rpm | 23 kB 00:00
(2/4): libnetfilter_cttimeout-1.0.0-7.el7.x86_64.rpm | 18 kB 00:00
(3/4): libnetfilter_cthelper-1.0.0-11.el7.x86_64.rpm | 18 kB 00:00
(4/4): conntrack-tools-1.4.4-7.el7.x86_64.rpm | 187 kB 00:00

Total 358 kB/s | 245 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libnetfilter_queue-1.0.2-2.el7_2.x86_64 1/4
Installing : libnetfilter_cthelper-1.0.0-11.el7.x86_64 2/4
Installing : libnetfilter_cttimeout-1.0.0-7.el7.x86_64 3/4
Installing : conntrack-tools-1.4.4-7.el7.x86_64 4/4
Verifying : libnetfilter_cttimeout-1.0.0-7.el7.x86_64 1/4
Verifying : libnetfilter_cthelper-1.0.0-11.el7.x86_64 2/4
Verifying : conntrack-tools-1.4.4-7.el7.x86_64 3/4
Verifying : libnetfilter_queue-1.0.2-2.el7_2.x86_64 4/4

Installed:
conntrack-tools.x86_64 0:1.4.4-7.el7

Dependency Installed:
libnetfilter_cthelper.x86_64 0:1.0.0-11.el7
libnetfilter_cttimeout.x86_64 0:1.0.0-7.el7
libnetfilter_queue.x86_64 0:1.0.2-2.el7_2

Complete!
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# curl -LO https://storage.googleapis.com/kubernetes-release/release/curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt/bin/linux/amd64/kubectl
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 45.7M 100 45.7M 0 0 1129k 0 0:00:41 0:00:41 --:--:-- 1125k
[root@localhost ~]#

[heidsoft@localhost ~]$ minikube start

  • minikube v1.29.0 on Centos 7.6.1810
  • Unable to pick a default driver. Here is what was considered, in preference or der:
    • docker: Not healthy: "docker version --format {{.Server.Os}}-{{.Server.Versi on}}:{{.Server.Platform.Name}}" exit status 1: Got permission denied while tryin g to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "ht tp://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
    • docker: Suggestion: Add your user to the 'docker' group: 'sudo usermod -aG d ocker $USER && newgrp docker' <https://docs.docker.com/engine/install/linux-post install/>
  • Alternatively you could install one of these drivers:
    • kvm2: Not installed: exec: "virsh": executable file not found in $PATH
    • vmware: Not installed: exec: "docker-machine-driver-vmware": executable file not found in $PATH
    • podman: Not installed: exec: "podman": executable file not found in $PATH
    • qemu2: Not installed: exec: "qemu-system-x86_64": executable file not found in $PATH
    • virtualbox: Not installed: unable to find VBoxManage in $PATH

X Exiting due to DRV_NOT_HEALTHY: Found driver(s) but none were healthy. See abo ve for suggestions how to fix installed drivers.

[heidsoft@localhost ~]$ docker run hello-world
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.
[heidsoft@localhost ~]$ sudo chmod 666 /var/run/docker.sock
[heidsoft@localhost ~]$ docker run hello-world

sudo groupadd docker
sudo usermod -aG docker ${USER}
docker run hello-world
sudo chmod 666 /var/run/docker.sock

minikube start --extra-config kubeadm.ignore-preflight-errors=SystemVerification --force-systemd=true --driver=docker --container-runtime=docker
minikube start --driver=docker --extra-config=kubelet.cgroup-driver=systemd
minikube start --driver=docker --container-runtime=containerd --cri-socket='/run/containerd/containerd.sock' --extra-config=kubelet.cgroup-driver=systemd

minikube start --driver=docker --container-runtime=docker --cri-socket='/run/containerd/containerd.sock' --extra-config=kubelet.cgroup-driver=systemd
minikube start --driver=docker --container-runtime=containerd --cri-socket='/run/containerd/containerd.sock' --extra-config=kubelet.cgroup-driver=systemd

minikube start --driver=docker --container-runtime=containerd --extra-config=kubelet.cgroup-driver=systemd
minikube start --driver=docker --container-runtime=containerd --extra-config=kubelet.cgroup-driver=systemd

http://www.njqityun.com/wap/grab/6175
https://github.com/kubernetes/minikube/issues/4172
https://github.com/kubernetes/minikube/issues/4144
https://sysnet4admin.gitbook.io/k8s/trouble-shooting/cluster-build/kubelet-is-not-properly-working-on-1.22-version
https://www.devopstory.cn/archives/杂谈/kubeadm安装采坑记录/
https://docs.docker.com/engine/install/centos/
https://developer.aliyun.com/article/701252
https://www.cnblogs.com/cosmos-wong/p/16635223.html
https://minikube.sigs.k8s.io/docs/faq/#docker-driver-how-can-i-set-minikubes-cgroup-manager
https://github.com/kubernetes/minikube/issues/14673

posted on 2023-02-02 10:13  heidsoft  阅读(625)  评论(0编辑  收藏  举报