Using minikube as Docker Desktop Replacement
Overview
- This guide will show you how to use minikube as a Docker Desktop replacement.
Before You Begin
-
This only works with the
docker
container runtime, not withcontainerd
orcrio
. -
You need to start minikube with a VM driver instead of
docker
, such ashyperkit
on macOS andhyperv
on Windows. -
Alternatively, you can use the
minikube image build
command instead ofminikube docker-env
anddocker build
.
Steps
1Install the Docker CLI
brew install docker
-
Download the static binary archive. Go to https://download.docker.com/mac/static/stable/ and select
x86_64
(for Mac on Intel chip) oraarch64
(for Mac on Apple silicon), and then download the.tgz
file relating to the version of Docker Engine you want to install. -
Extract the archive using the
tar
utility. Thedocker
binary is extracted.
tar xzvf /path/to/<FILE>.tar.gz
- Clear the extended attributes to allow it run.
sudo xattr -rc docker
- Move the binary to a directory on your executable path, such as
/usr/local/bin/
.
sudo cp docker/docker /usr/local/bin/
Please Note: The docker engine requires the Windows Features: Containers and Microsoft-Hyper-V to be installed in order to function correctly. You can install these with the chocolatey command:
choco install Containers Microsoft-Hyper-V --source windowsfeatures
- Install docker-engine
choco install docker-engine
- This package creates the group
docker-users
and adds the installing user to it. In order to communicate with docker you will need to log out and back in.
-
Download the static binary archive. Go to https://download.docker.com/win/static/stable/x86_64 and select the latest version from the list.
-
Run the following PowerShell commands to install and extract the archive to your program files:
Expand-Archive /path/to/<FILE>.zip -DestinationPath $Env:ProgramFiles
-
Add the path to the Docker CLI binary (
C:\Program Files\Docker
) to thePATH
environment variable, guide to setting environment variables in Windows. -
Restart Windows for the
PATH
change to take effect.
2Start minikube
Start minikube with a VM driver and `docker` container runtime if not already running.minikube start --container-runtime=docker --vm=true
3Point Docker CLI to minikube
Use the `minikube docker-env` command to point your terminal's Docker CLI to the Docker instance inside minikube.
Note: the default profile name is minikube
eval $(minikube -p <profile> docker-env)
& minikube -p <profile> docker-env --shell powershell | Invoke-Expression
@FOR /f "tokens=*" %i IN ('minikube -p <profile> docker-env --shell cmd') DO @%i
minikube -p <profile> docker-env | source
eval `minikube -p <profile> docker-env`
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.