1.安装docker和docker-compose
菜鸟教程链接:https://www.runoob.com/docker/centos-docker-install.html
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
查看成功了没
docker -v
看到这个说明ok了。
安装docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
$ Docker Compose version v2.2.2 说明ok
2.安装minikube
官网:https://minikube.sigs.k8s.io/docs/start/
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
3.打开minikube
首先确保你的docker开启了
systemctl start docker
systemctl stop docker
systemctl restart docker
systemctl status docker
systemctl enable docker
docker要换源,不然慢的要死。
nano /etc/docker/daemon.json
{
"registry-mirrors":[
"http://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com",
"http://registry.docker-cn.com"
] ,
"insecure-registries":[
"docker.mirrors.ustc.edu.cn",
"registry.docker-cn.com"
]
}
重启docker
systemctl restart docker
开启minikube,注意不要用root用户。 会提示你这个,如图 这是因为你的docker在当前用户(非root)没有操作权限 把$user换成你的用户名。
sudo usermod -aG docker zp && newgrp docker
开启minikube
minikube start --image-mirror-country='cn'
如果你换源了,那么你会看到 等待下载,直到成功 可以看我下文的教程安装kubectl
其他相关
安装kubectl: https://blog.csdn.net/weixin_44379605/article/details/123124172?spm=1001.2014.3001.5502
minikube和kubectl常用命令: https://blog.csdn.net/weixin_44379605/article/details/122462727?spm=1001.2014.3001.5502
|