Docker 安装:
- $ brew cask install docker
- $ docker --version (查看版本,是否安装成功)
- $ docker image ls (查看运行的镜像)
- docker container ps (查看运行的容器)
- $ docker container stop docker-demo (容器停止)
- $ docker container rm docker-demo (容器清理)
Kubernetes 安装:
需要用VPN链接,才能顺利完成安装。
- $ brew install kubectl (命令行客户端 kubctl)
- $ brew cask install minikube (本地跑起来的 Kubernetes 环境 Minikube)
- $ brew install docker-machine-driver-hyperkit
- $ sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
- $ sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
- $ minikube start --vm-driver hyperkit
- $ kubectl get nodes
- $ eval $(minikube docker-env) (与 Minikube 中的 Docker 进程通讯)
- $ docker build -t k8s-demo:1 . (重新构建镜像k8s-demo:1)