Running Docker without Docker Desktop

Docker is great. Docker Desktop sucks. Here’s my fix.

TL;DR

  1. brew install qemu docker colima (colima replaces the docker/dockerd binary, qemu helps you unable to resize disk for v big images)
  2. Install the right docker-compose binary for your chipset from the releases page
    • sudo curl -L https://github.com/docker/compose/releases/download/v2.5.1/docker-compose-darwin-aarch64 -o /usr/local/bin/docker-compose for M1 Macs
    • chmod +x /usr/local/bin/docker-compose to let it execute

Now you can start the docker daemon with colima start. You’ll need to do this the first time you run the docker binary in every session.

You can also run docker-compose up as per normal but without needing Docker Desktop.

Context

Although I am known for loving Docker (the containerization technology), I am also known for being a critic of Docker Desktop (the desktop UI client for Docker) for its poor performance:

image

The constant upgrade nags until you pay them also don’t inspire any love whatsoever.

Docker Desktop is Docker (the company)‘s first wedge into getting you to run proprietary software, so Docker strongly guides you to download it as the only way to get started:

In fact, new users can go pretty far without even realizing that you don’t need Docker Desktop to run the Docker daemon. I’ve asked multiple people how to do it and nobody had a good answer, or at least, nobody had an answer that worked on M1 Macs, until now.

For my 2022 New Mac Setup guide I resolved to figure it out once and for all, and what you see here is what I ended up with!

OK I’m ready to try it!

You already missed the instructions. scroll up to TL;DR :)

Troubleshooting 1

A user reported this issue with colima:

FATA[0000] error starting vm: error at ‘starting’: exit status 1

try reinstalling:

brew unlink colima # If it is already installed, uninstall it first

brew install --HEAD colima

colima start --runtime docker

docker ps # success 

Troubleshooting 2

In the comments, @sreetamdas reported Cannot connect to the Docker daemon at unix:///var/run/docker.sock. errors.

# In order to use the `docker` runtime:
brew install docker

# Start colima
colima start --runtime docker


# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
export DOCKER_HOST="unix://${HOME}/.colima/default/docker.sock"

Nov 2022 Edit: Podman

you could also try Podman: https://podman-desktop.io/ https://news.ycombinator.com/item?id=33536978#33539372

Oct 2023 update: Orbstack

https://orbstack.dev/

Reactions: ❤️ 2
Loading comments...
Webmentions
❤️ 0 💬 9
  • avatar of mvouma mvouma michel
    mvouma mvouma michel retweeted
  • fenq.com  mentioned this on 2022-06-14
  • fenq.com  mentioned this on 2022-05-31
  • idushu.com  mentioned this on 2022-05-31
  • avatar of swyx
    swyx mentioned this on 2022-05-28

    havent encountered it yet. to be fair i'm a very light user of docker, i just do the basic pull and docker compose up commands and only occasionally build my own images

  • avatar of Kevin Ashworth 🇺🇸
    Kevin Ashworth 🇺🇸 mentioned this on 2022-05-28

    Nice. This looks like the way to go. Any insight into pros/cons of installing docker as you did vs `brew install docker`?

  • avatar of Kevin Ashworth 🇺🇸
    Kevin Ashworth 🇺🇸 mentioned this on 2022-05-28

    Thanks for the reply. I'm going to try brew for both colima and docker and see how it goes.

  • avatar of Karan Sapolia
    Karan Sapolia retweeted
  • avatar of Raighne
    Raighne mentioned this on 2022-05-28

    在M1上试了下,感觉不错。使用colima替代docker desktop

  • avatar of Sibelius Seraphini
    Sibelius Seraphini retweeted
  • avatar of Ben Barber
    Ben Barber mentioned this on 2022-05-27

    I will definitely be doing this. Docker Desktop drives me mad, it constantly bugs out and the software update process never works smoothly.

  • avatar of swyx
    swyx mentioned this on 2022-05-27

    ok i now run both docker and docker-compose without using Docker Desktop, thanks for all the folks who advised me to try colima (i had tried it before but it didnt seem to work on m1 mac's last time. now it does)

  • avatar of Ben Barber
    Ben Barber retweeted
  • avatar of Gyan Kapur
    Gyan Kapur retweeted
  • avatar of SR Sajjad
    SR Sajjad retweeted

Subscribe to the newsletter

Join >10,000 subscribers getting occasional updates on new posts and projects!

I also write an AI newsletter and a DevRel/DevTools newsletter.

Latest Posts

Search and see all content