一、安装docker(阿里云镜像安装)
1.卸载旧版本
sudo apt-get remove docker docker-engine docker-ce docker.io
2.添加阿里云GPG秘钥
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
3.设置存储库
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
4.安装docker
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
5.验证
sudo docker version systemctl status docker,未运行时执行sudo systemctl start docker启动docker sudo docker run hello-world 运行个容器试下 sudo systemctl enable docker # 设置开机自启
6.阿里镜像加速
https://cr.console.aliyun.com/cn-shanghai/instances/mirrors
二、安装minikube
1.依赖
sudo apt-get install -y apt-transport-https
2.添加阿里GPG
sudo curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -
3.添加阿里apt源
sudo tee /etc/apt/sources.list.d/kubernetes.list <<-'EOF' deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main EOF sudo apt-get update
4.安装kubectl
sudo apt-get install -y kubectl
5.添加用户到docker组
sudo usermod -aG docker $USER && newgrp docker
6.安装mibikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube
7.启动minikube
minikube start --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --kubernetes-version=1.23.8
为了方便,设置alias
sudo vim .bashrc
加上 2 条 alias
alias minikube.cn="minikube start --image-mirror-country=cn --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --kubernetes-version=1.23.8" alias kubectl="minikube kubectl --"
启动生效
source .bashrc
三、验证
1.查询所有namespace中的 pods
kubectl get po -A
参考:
https://www.cnblogs.com/Can-daydayup/p/16472375.html
https://blog.csdn.net/u010953609/article/details/121489147
标签:ubuntu20.04,--,com,sudo,apt,minikube,docker,安装 From: https://www.cnblogs.com/hujq1029/p/17467339.html