OrbStack 無痛取代 Docker Desktop


更換原因


Docker Desktop 在本人 MacBook Air 上實在跑太慢了,光 MySQL 要啟動完全就需要好幾分鐘,記憶體不夠的話可能還會 Crash 要重開,換了 OrbStack 後真的夠速,不用幾秒鐘就啟動完成,效能也提升不少。

需要 macOS 13.0 以上

INFO Preview builds expire after 30 days. Stable versions will never expire. macOS 13.0 or newer is required.

安裝


用 brew 安裝

brew install orbstack

將 Docker 的設定遷移到 OrbStack(因為 Docker Desktop 跟 OrbStack 會一起啟動所以在我的 Air 上跑滿久的)

orb migrate docker
INFO[0000] Starting Docker Desktop
INFO[0000] Gathering info
INFO[0001]                                               progress=4
INFO[0007] Migration started                             started=true
INFO[0007] Migrating image laradock-php-fpm:latest
INFO[0007] Migrating image laradock-nginx:latest
INFO[0007] Migrating image laradock-redis:latest
INFO[0007] Migrating image laradock-mysql:latest
INFO[0007] Migrating image laradock-workspace:latest
INFO[0052]                                               progress=8
INFO[0052] Migrating image laradock-mongo:latest
INFO[0068]                                               progress=12
INFO[0068] Migrating image laradock-phpmyadmin:latest
INFO[0216]                                               progress=16
INFO[0216] Migrating image docker:20.10-dind
INFO[0235]                                               progress=20
INFO[0235] Migrating volume laradock_mssql
INFO[0239]                                               progress=24
INFO[0239] Migrating volume 55aca73f1c578bc790ddb329bd6ed433cffcf8d6c6a0826f22347cb4a5036d9c
INFO[0244]                                               progress=28.000000000000004
INFO[0244] Migrating volume 60550b5dc34ebd6c738b38ecd7709f6336d0ecc0a66b9759ac1c5f2825b286da
INFO[0246]                                               progress=32
INFO[0246] Migrating volume 606eda52d89ff90a55ff744181dc1c7894fac7ddf3414633f4508e4769f5edca
INFO[0249]                                               progress=36
INFO[0249] Migrating volume a09de01cd0c9ab3da1f7a6a7a9dcf990689dcc59db6c142ca26e05979f21a01e
INFO[0253]                                               progress=40
INFO[0253] Migrating volume laradock_docker-in-docker
INFO[0256]                                               progress=44
INFO[0256] Migrating volume laradock_elasticsearch
INFO[0260]                                               progress=48
INFO[0260] Migrating network laradock_backend
INFO[0260]                                               progress=52
INFO[0260] Migrating network laradock_frontend
INFO[0260]                                               progress=56.00000000000001
INFO[0273]                                               progress=60
INFO[0309]                                               progress=64
INFO[0347]                                               progress=68
INFO[0468]                                               progress=72
INFO[0468] Migrating container /laradock-php-fpm-1
INFO[0468] Migrating container /laradock-nginx-1
INFO[0468] Migrating container /laradock-workspace-1
INFO[0468] Migrating container /laradock-phpmyadmin-1
INFO[0468] Migrating container /laradock-mysql-1
INFO[0474]                                               progress=76
INFO[0474] Migrating container /laradock-redis-1
INFO[0474]                                               progress=80
INFO[0474] Migrating container /laradock-docker-in-docker-1
INFO[0474]                                               progress=84
INFO[0475]                                               progress=88
INFO[0475]                                               progress=92
INFO[0475]                                               progress=96
INFO[0481]                                               progress=100
INFO[0482] Stopping Docker Desktop
INFO[0497] Done

切換


可以透過指令讓 Docker Desktop 跟 OrbStack 快速切換

# Switch to OrbStack
docker context use orbstack
# Switch to Docker Desktop
docker context use desktop-linux

設定硬體資源限制


如果要限制使用的資源記得到 command + , > System 設定記憶體跟 CPU 限制

或是下指令修改

# 限制 RAM Limti 2GB
orb config set memory_mib 2048
# 限制 CPU 800% (7 = 700%, 8 = 800% 以此類推)
orb config set cpu 8
# OrbStack 重啟
orb stop
orb start

License


When you install OrbStack, you will get a Pro trial that allows commercial use for 30 days. After the trial, it will degrade to Free (personal use only).

安裝完後有 30 天的 Pro 免費試用,結束後回歸個人使用,如果有商用並達到年收入 10,000 美元以上就需要付費。
個人版本雖然功能都一樣也可以用,但如果有達到條件乖乖付錢吧!

OrbStack License

參考:
https://docs.orbstack.dev/install
https://docs.orbstack.dev/settings
https://docs.orbstack.dev/licensing