Skip to content

Instantly share code, notes, and snippets.

@juancsr
Last active July 1, 2025 15:26
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

@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

@thedevd
Copy link

thedevd commented Jul 1, 2025

Not able to connect to postgres with minikube ip (it timed out) and also using localhost not working

docker run --name postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres -d -p 5432:5432 -v pgdata:/var/lib/postgresql/data postgres

$ minikube ip
10.0.2.15
docker ps                         
CONTAINER ID   IMAGE                        COMMAND                  CREATED          STATUS          PORTS                    NAMES
41264a9ed8fe   postgres                     "docker-entrypoint.s…"   10 minutes ago   Up 10 minutes   0.0.0.0:5432->5432/tcp   postgres
$ psql -h 10.0.2.15 -U postgres
psql: error: connection to server at "10.0.2.15", port 5432 failed: Operation timed out
        Is the server running on that host and accepting TCP/IP connections?
 $ psql -h localhost -U postgres
psql: error: connection to server at "localhost" (::1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
$ psql -h 0.0.0.0 -U postgres
psql: error: connection to server at "0.0.0.0", port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?

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