0

I'm trying to use minikube but I don't want to install docker desktop so I installed docker engine but is there any way to use minikube start --driver=docker with docker engine on ubuntu?

Thanks!

Rafael Souza
  • 1,143
  • 2
  • 13
  • 29

1 Answers1

1

Minikube is the officially supported way to run Kubernetes locally on macOS, Windows, or Linux. Furthermore, it is the only tool that is a drop-in replacement for Docker Desktop if you're running Kubernetes and Docker. It runs on macOS through the Hypervisor.framework, Windows through Hyper-V, and Linux either natively (without a virtual machine), docker, or KVM. You can also use virtualbox to run the machine.

The docker engine which is the core software behind the docker only runs on Linux kernel(the engine can run on a physical or a virtual machine, but it can only run on top of a Linux kernel i.e. any OS that is flavor of Linux). Since Docker Engine only runs on Linux, developers who use Windows and macOS for software development cannot run the engine until they spin up a virtual machine (VM) that runs linux.

Docker Desktop is not the core technology that runs containers, it only aims to make it easier to develop software on Windows/macOS that runs in containers. So we can replace Docker Desktop with using native Linux VM(and Hypervisor).

This only works with the docker container runtime, not with containerd or crio. You need to start minikube with a VM driver instead of docker, such as hyperkit on macOS and hyperv on Windows. Alternatively, you can use the minikube image build command instead of minikube docker-env and docker build.

Steps to use minikube as Docker Desktop Replacement:

  1. Install the Docker CLI

  2. Start minikube by using the following command:

    $ minikube start --kubernetes-version= < version > --driver=< driver-name> --container-runtime=docker

    (Note: If you are using MacOS the –driver will be hyperkit, if it is Windows then the driver will be hyperv)

  3. Now Point Docker CLI to minikube.

Refer to Using minikube as Docker Desktop Replacement and Goodbye Docker Desktop, Hello Minikube! for more information. Also refer An Overview of Docker Desktop Alternatives.

Jyothi Kiranmayi
  • 2,090
  • 5
  • 14
  • I ran the command you told me but at the end it gives this error: `W0829 20:14:30.693743 91371 out.go:239] ❌ Exiting due to GUEST_PROVISION_CP_PUBKEY: Failed to start host: creating host: create: creating: prepare kic ssh: copying pub key: docker copy /tmp/tmpf-memory-asset3008640236 into minikube:/home/docker/.ssh/authorized_keys, output: unknown shorthand flag: 'a' in -a See 'docker cp --help'. : exit status 125 ` thanks! – Rafael Souza Aug 29 '22 at 23:50
  • Try this [solution](https://stackoverflow.com/a/65423698/15745153) for the above mentioned error. – Jyothi Kiranmayi Aug 30 '22 at 02:57
  • I did everything in the post but it gives the same error message. Does anyone have any idea of ​​this error? thanks! – Rafael Souza Aug 31 '22 at 00:38