Skip to content

Instantly share code, notes, and snippets.

@juancsr
Last active November 13, 2024 10:35
Show Gist options
  • 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

@juancsr
Copy link
Author

juancsr commented Aug 16, 2023

hi, I tried to do it but I can't install docker-credential-helper, can you help?

@kapscudi Try the offical repo instructions https://github.com/docker/docker-credential-helpers

@sastorsl
Copy link

Could perhaps replace brew install hyperkit with

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

@er1c
Copy link

er1c commented Oct 17, 2023

It's brew install docker-credential-helper

@xama
Copy link

xama commented Nov 24, 2023

Hello
the command: bash minikube start
throws : /opt/homebrew/bin/minikube: /opt/homebrew/bin/minikube: cannot execute binary file
any idea please ? many thanks

@theanh90
Copy link

Hello the command: bash minikube start throws : /opt/homebrew/bin/minikube: /opt/homebrew/bin/minikube: cannot execute binary file any idea please ? many thanks

You should run minikube start instead

@bfeitknecht
Copy link

how can you run docker with qemu exactly?

@juliangovender
Copy link

how can you run docker with qemu exactly?

minikube start --driver=qemu

@shiv19
Copy link

shiv19 commented Feb 1, 2024

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

@Aryanamish
Copy link

Cant access my server which is running inside a docker container on minikube ip
640fa9aad84d httpd:2.4 "httpd-foreground" 3 minutes ago Up 3 minutes 0.0.0.0:8080->80/tcp my-apache-app

if i goto http://10.0.2.15:8080/ i cant access it

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