diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index a167ae28acd3..8cf458d8c782 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -619,9 +619,6 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, rtime str } if si.Rootless { out.Styled(style.Notice, "Using rootless {{.driver_name}} driver", out.V{"driver_name": driver.FullName(drvName)}) - if cc.KubernetesConfig.ContainerRuntime == constants.Docker { - exit.Message(reason.Usage, "--container-runtime must be set to \"containerd\" or \"cri-o\" for rootless") - } // KubeletInUserNamespace feature gate is essential for rootless driver. // See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-in-userns/ cc.KubernetesConfig.FeatureGates = addFeatureGate(cc.KubernetesConfig.FeatureGates, "KubeletInUserNamespace=true") diff --git a/pkg/minikube/cruntime/docker.go b/pkg/minikube/cruntime/docker.go index fd861bd10dc1..e4199b9b2c3b 100644 --- a/pkg/minikube/cruntime/docker.go +++ b/pkg/minikube/cruntime/docker.go @@ -134,9 +134,15 @@ func (r *Docker) Active() bool { // Enable idempotently enables Docker on a host func (r *Docker) Enable(disOthers bool, cgroupDriver string, inUserNamespace bool) error { if inUserNamespace { - return errors.New("inUserNamespace must not be true for docker") + if err := CheckKernelCompatibility(r.Runner, 5, 11); err != nil { + // For using overlayfs + return fmt.Errorf("kernel >= 5.11 is required for rootless mode: %w", err) + } + if err := CheckKernelCompatibility(r.Runner, 5, 13); err != nil { + // For avoiding SELinux error with overlayfs + klog.Warningf("kernel >= 5.13 is recommended for rootless mode %v", err) + } } - if disOthers { if err := disableOthers(r, r.Runner); err != nil { klog.Warningf("disableOthers: %v", err) diff --git a/site/content/en/docs/drivers/docker.md b/site/content/en/docs/drivers/docker.md index 4117a69f4f22..2d1db496a4b6 100644 --- a/site/content/en/docs/drivers/docker.md +++ b/site/content/en/docs/drivers/docker.md @@ -49,7 +49,7 @@ minikube start --driver=docker --container-runtime=containerd Unlike Podman driver, it is not necessary to set the `rootless` property of minikube (`minikube config set rootless true`). When the `rootless` property is explicitly set but the current Docker host is not rootless, minikube fails with an error. -The `--container-runtime` flag must be set to "containerd" or "cri-o". "containerd" is recommended. +It is recommended to set the `--container-runtime` flag to "containerd". {{% /tab %}} {{% /tabs %}}