纯新手记录本身搭建过程.git
官方教程
基本是下载,点点点okgithub
brew mac 包管理(相似于yum,apt)
命令行执行spring
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
官网 自带中文docker
brew 本质上也是git pull ,因此当源是一些国外源,因为某些不可描述的缘由,因此会很慢,甚至可能访问不了.
因此咱们要换成git的源.原理是 brew update --verbose 观察卡到哪里,cd到那个目录,替换(git remote set-url origin )ruby
# 替换brew.git: cd "$(brew --repo)" git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git # 替换homebrew-core.git: cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git # 替换homebrew-cask.git: cd "$(brew --repo)"/Library/Taps/homebrew/homebrew-cask git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git # 替换homebrew-bottles: echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc source ~/.zshrc
mac单机安装k8s,目前分两种方案.1、docker desktop上Kubernetes集群.2、minikube.
本人选择minikube.
1、docker desktop,自动从k8s拉去镜像,解决办法是本身拉去镜像,而后docker tag 修改为k8s的镜像.因此docker desktop每次升级,必须手动拉去镜像,就该tag.比较麻烦.
2、docker desktop 安装的集群须要本身配置插件,minikube自带一些插件,后期可控.
3、minikube能够跨操做系统安装,相对来讲泛用.curl
mac 虚拟化微服务
sysctl -a | grep -E --color 'machdep.cpu.features|VMX'
底层采用 hyperkit 虚拟机(也能够用其余 好比 VirtualBox、VMware Fusion)测试
brew install hyperkit
正式installgoogle
brew cask install minikube # 命令查看 minikube help
# minikube config 用户配置一些环境 # minikube config --help 查看帮助 # minikube config view 查看全部配置 # minikube config get/set k v 获取配置/设置配置 minikube config set dashboard true # 指定驱动 若是用 其余修改 minikube config set vm-driver hyperkit minikube start --logtostderr --v=3 --registry-mirror=https://registry.docker-cn.com --registry-mirror=https://8eoqixdq.mirror.aliyuncs.com --registry-mirror=https://dockerhub.azk8s.cn --insecure-registry=local.registry:5000 --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers --vm-driver="hyperkit" --memory=4096 # v=3 配置日历(可选) # registry-mirror 镜像加速地址 (必须不然会很慢) # https://registry.docker-cn.com # https://8eoqixdq.mirror.aliyuncs.com # https://dockerhub.azk8s.cn # insecure-registry 本地镜像仓储(可选) # image-repository(必须带,重点,重点) # registry.cn-hangzhou.aliyuncs.com/google_containers minikube status # 查询状态 minikube start/stop/delete # k8s 集群启动 中止 删除