Docker + kubernetes安装(Minikube)

Posted on 2019-11-18 14:51  xiaoyongyang  阅读(1898)  评论(0编辑  收藏  举报

Docker 安装: 

  1. $ brew cask install docker         
  2. $ docker --version                  (查看版本,是否安装成功)
  3. $ docker image ls                   (查看运行的镜像)
  4.  docker container ps                  (查看运行的容器)
  5. $ docker container stop docker-demo   (容器停止)
  6. $ docker container rm docker-demo  (容器清理)

Kubernetes 安装:

需要用VPN链接,才能顺利完成安装。

  1. $ brew install kubectl    (命令行客户端 kubctl)
  2. $ brew cask install minikube     (本地跑起来的 Kubernetes 环境 Minikube)
  3. $ brew install docker-machine-driver-hyperkit
  4. $ sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
  5. $ sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
  6. $ minikube start --vm-driver hyperkit
  7. $ kubectl get nodes
  8. $ eval $(minikube docker-env)    (与 Minikube 中的 Docker 进程通讯)
  9. $ docker build -t k8s-demo:1 .    (重新构建镜像k8s-demo:1)  

Copyright © 2024 xiaoyongyang
Powered by .NET 9.0 on Kubernetes