DEV Community

Cover image for minikube with the Docker Driver on Ubuntu: A Practical Local Cluster
James Joyner
James Joyner

Posted on

minikube with the Docker Driver on Ubuntu: A Practical Local Cluster

minikube is the other "Kubernetes in Docker" option on Ubuntu, and with --driver=docker it runs the cluster inside a Docker container just like kind — but ships with addons (ingress, metrics-server, dashboard, a built-in registry) that make it feel more like a real cluster. Here's a practical setup and how it differs from kind.

Install on Ubuntu

You need Docker first (sudo apt-get install -y docker.io, then add yourself to the docker group). Then:

curl -fsSLo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube /usr/local/bin/minikube
minikube version
Enter fullscreen mode Exit fullscreen mode

Start with the Docker driver

minikube start --driver=docker
# make it the default so you don't repeat the flag:
minikube config set driver docker

kubectl get nodes
docker ps    # a 'minikube' container is your node
Enter fullscreen mode Exit fullscreen mode

Size it for real work:

minikube start --driver=docker --cpus=4 --memory=8g --disk-size=40g
Enter fullscreen mode Exit fullscreen mode

The addons are the reason to pick minikube

minikube addons list
minikube addons enable ingress
minikube addons enable metrics-server
minikube dashboard        # opens the web UI
Enter fullscreen mode Exit fullscreen mode

ingress gives you a working NGINX ingress controller with no manifest wrangling — genuinely useful when you want to test ingress routing locally.

The Docker image workflow

minikube runs its own Docker daemon inside the node container. The neat trick is pointing your shell's Docker CLI at that daemon, so images you build are immediately visible to the cluster with no push:

eval $(minikube docker-env)     # your `docker` now talks to minikube's daemon
docker build -t myapp:dev .
kubectl create deployment myapp --image=myapp:dev
# remember: imagePullPolicy: IfNotPresent so it doesn't try a registry pull
Enter fullscreen mode Exit fullscreen mode

Undo it when you're done so docker points back at your host daemon:

eval $(minikube docker-env -u)
Enter fullscreen mode Exit fullscreen mode

There's also a built-in registry if you prefer the push model:

minikube addons enable registry
Enter fullscreen mode Exit fullscreen mode

Accessing services from Ubuntu

Two common patterns:

# quick tunnel to a single service (prints a URL)
minikube service myapp --url

# LoadBalancer support on your host (needs sudo; keep it running in a terminal)
minikube tunnel
Enter fullscreen mode Exit fullscreen mode

minikube vs kind — how I choose

  • kind: faster start, lighter, multi-node config is trivial, ideal for CI and quick throwaways.
  • minikube: heavier, single-node by default, but addons (ingress, metrics, registry, dashboard) and the docker-env trick make it nicer for interactive local development.

Both run "Kubernetes with Docker" in the most literal sense — the cluster is a Docker container. Neither reflects how production nodes run (that's the containerd/cri-dockerd posts earlier in this series), so don't debug production runtime issues on them.

Cleanup

minikube stop        # keep the cluster, free the resources
minikube delete      # nuke it entirely
Enter fullscreen mode Exit fullscreen mode

When a workload misbehaves on minikube it's ordinary Kubernetes troubleshooting — start with kubectl describe pod and kubectl logs, and the pod-startup error hub for the specific messages.

Next: the failure mode that quietly breaks more Ubuntu nodes than anything else — the systemd cgroup driver mismatch.

Top comments (0)