From d88725915362c4cc3a5bae528b2d06df27cdb75c Mon Sep 17 00:00:00 2001 From: Medya Gh Date: Sat, 2 May 2020 20:19:17 -0700 Subject: [PATCH] add to registry --- cmd/minikube/cmd/start.go | 2 +- pkg/minikube/registry/drvs/docker/docker.go | 6 +++++- site/content/en/docs/drivers/docker.md | 16 +++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index 9cbc356b46..428784de23 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -160,7 +160,7 @@ func runStart(cmd *cobra.Command, args []string) { out.ErrLn("") out.ErrT(out.Conflict, "Your Docker Desktop container os type is Windows but Linux is required.") out.T(out.Warning, "Please change Docker settings to use Linux containers instead of Windows containers.") - out.T(out.Documentation, "https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers") + out.T(out.Documentation, "https://minikube.sigs.k8s.io/docs/drivers/docker/#verify-docker-container-type-is-linux") exit.UsageT(`You can verify your Docker container type by running: {{.command}} `, out.V{"command": "docker info --format '{{.OSType}}'"}) diff --git a/pkg/minikube/registry/drvs/docker/docker.go b/pkg/minikube/registry/drvs/docker/docker.go index 6f47a34a1d..bad19f3fba 100644 --- a/pkg/minikube/registry/drvs/docker/docker.go +++ b/pkg/minikube/registry/drvs/docker/docker.go @@ -81,9 +81,13 @@ func status() registry.State { defer cancel() // Quickly returns an error code if server is not running - cmd := exec.CommandContext(ctx, oci.Docker, "version", "--format", "{{.Server.Version}}") + cmd := exec.CommandContext(ctx, oci.Docker, "version", "--format", "{{.Server.Os}}-{{.Server.Version}}") o, err := cmd.Output() output := string(o) + if !strings.Contains(output,"windows-") { + return registry.State{Error: oci.ErrWindowsContainers, Installed: true, Healthy: false, Fix: "Change container type to \"linux\" in Docker Desktop settings", Doc: docURL+"#verify-docker-container-type-is-linux"} + + } if err == nil { glog.Infof("docker version: %s", output) return registry.State{Installed: true, Healthy: true} diff --git a/site/content/en/docs/drivers/docker.md b/site/content/en/docs/drivers/docker.md index c3a809288a..72e187a887 100644 --- a/site/content/en/docs/drivers/docker.md +++ b/site/content/en/docs/drivers/docker.md @@ -30,16 +30,18 @@ The Docker driver allows you to install Kubernetes into an existing Docker insta ## Troubleshooting -- On macOS or Windows, you may need to restart Docker for Desktop if a command gets hung - -- Run `--alsologtostderr -v=1` for extra debugging information - +[comment]: <> (this title is used in the docs links, don't change) +### Verify Docker container type is Linux - On Windows, make sure Docker Desktop's container type setting is Linux and not windows. see docker docs on [switching container type](https://docs.docker.com/docker-for-windows/#switch-between-windows-and-linux-containers). You can verify your Docker container type by running: -```shell - docker info --format '{{.OSType}}' -``` + ```shell + docker info --format '{{.OSType}}' + ``` +### Run with logs +- Run `--alsologtostderr -v=1` for extra debugging information + +### Deploying MySql on a linux with AppArmor - On Linux, if you want to run MySQL pod, you need to disable AppArmor for mysql profile If your docker has [AppArmor](https://wiki.ubuntu.com/AppArmor) enabled, running mysql in privileged mode with docker driver will have the issue [#7401](https://github.com/kubernetes/minikube/issues/7401).