Skip to content

Instantly share code, notes, and snippets.

@richkuz
Last active January 18, 2022 14:25
Show Gist options
  • Save richkuz/f01a1a621442f0e812fd9b743805fd62 to your computer and use it in GitHub Desktop.
Save richkuz/f01a1a621442f0e812fd9b743805fd62 to your computer and use it in GitHub Desktop.
Run minikube as a replacement for Docker Desktop

How to use Minikube as a replacement for Docker Desktop for Mac.

Uninstall Docker Desktop

To uninstall Docker Desktop for Mac run /Applications/Docker.app/Contents/MacOS/Docker --uninstall or uninstall it from the Docker Desktop UI Preferences under the "Troubleshooting" bug icon.

Install Docker client binary

Download the Docker CLI client binary for Mac from https://download.docker.com/mac/static/stable/. The Mac Docker CLI client binary source code is Apache Licensed. Unpack and copy docker to /usr/local/bin.

Install Minikube and Hyperkit

brew install minikube
brew install hyperkit

Start Minikube and wire up the Docker client

# Default 6GB, increase it if needed
minikube start --memory 16384

# Magic command to allow `docker` commands to work 
eval $(minikube -p minikube docker-env)

Docker away!

docker ps

# Or use kubectl!
kubectl get po -A

# Or launch a K8s dashboard!
minikube dashboard
@richkuz
Copy link
Author

richkuz commented Nov 1, 2021

Video walk-through of the above commands:

video1201886888.mp4

@richkuz
Copy link
Author

richkuz commented Nov 17, 2021

To use docker-compose:

@richkuz
Copy link
Author

richkuz commented Nov 18, 2021

To run with more memory, more disk space, and no K8s cluster:

minikube start --memory 16384 --disk-size 55000mb --no-kubernetes

To forward exposed container ports out of Minikube onto your local host network, use an SSH tunnel (replace 9200 with the exposed container port to forward to your localhost):

ssh -g -L 9200:localhost:9200 -N -i ~/.minikube/machines/minikube/id_rsa docker@$(minikube ip)

@richkuz
Copy link
Author

richkuz commented Jan 18, 2022

This step may not work with M1 Macs because the hypervisor doesn't support ARM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment