Skip to content

Instantly share code, notes, and snippets.

@juancsr
Last active April 17, 2024 15:05
Show Gist options
  • Star 49 You must be signed in to star a gist
  • Fork 14 You must be signed in to fork a gist
  • Save juancsr/5927e6660d6ba5d2a34c61802d26e50a to your computer and use it in GitHub Desktop.
Save juancsr/5927e6660d6ba5d2a34c61802d26e50a to your computer and use it in GitHub Desktop.
Use docker in mac without docker-

Run docker in macos without docker desktop

NOTE: I want disclaimer that this work is not complete mine. Most of the work here is comming from: https://dhwaneetbhatt.com/blog/run-docker-without-docker-desktop-on-macos

Run brew doctor and update to make sure everything is working and up to date

$ brew doctor
$ brew update

According to your OS architecture, you might need to install hyperkit or minikube

$ test $(uname -p) = arm && brew install qemu || brew install hyperkit

Install hyperkit and minikube

$ brew install minikube

Install Docker CLI

$ brew install docker
$ brew install docker-compose

Start minikube

$ bash minikube start

Tell Docker CLI to talk to minikube's VM

$ eval $(minikube docker-env)

Save IP to a hostname

$ echo "`minikube ip` docker.local" | sudo tee -a /etc/hosts > /dev/null

Test

$ docker run hello-world

Install docker-credential-helper

$ install docker-credential-helper

Update your .docker/config.json file to NOT TO USE desktop as credStore

Original (if you had docker-desktop installed)

{
  "credsStore" : "desktop"
}

Update desktop value in credsStore value for osxkeychain After

{
  "credsStore" : "osxkeychain"
}

Portforward ports

Keep in mind that now your ports are being portforward to minikube instead of your localhost. So if you have the 8080 port forwarded insead of localhost:8080 you should get your minikube ip ($ minikube ip) and then do <your_minikube_ip>:8080

@shiv19
Copy link

shiv19 commented Feb 1, 2024

@juancsr , can you please update it to brew install docker-credential-helper on the gist :)

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