mac上安装orbstack容器化管理工具

OrbStack 是一款专为 macOS 系统设计的轻量级容器和虚拟机管理工具,旨在为开发者提供更高效、更快速的本机开发环境。它通过优化资源占用和启动速度

env

  • macbook-pro 15.3
  • orbstack

基于dmg安装

  1. 下载安装
    访问 OrbStack 官网 下载 macOS 客户端,拖拽安装至 Applications 目录。
  2. 启动服务
    首次启动会自动安装依赖(如 Docker CLI),并创建默认 Linux 虚拟机。
  3. 运行容器
    直接使用 docker run 命令(例如 docker run -it nginx),OrbStack 会自动托管容器。
  4. 管理虚拟机
    使用 orb CLI 或 GUI 创建、启动和停止虚拟机。

基于brew安装

1.配置好brew相关信息

2.brew安装

brew search orbstack
brew install --casks  orbstack

安装过程信息

➜  joplin-blog git:(main) ✗ brew search orbstack
==> Casks
orbstack                                                stack
➜  joplin-blog git:(main) ✗ brew install --casks  orbstack
==> Caveats
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-cask/d121432013edcd9eec05f4cca33082510b79b
####################################################################################################### 100.0%
==> Downloading https://cdn-updates.orbstack.dev/amd64/OrbStack_v1.9.5_18849_amd64.dmg
####################################################################################################### 100.0%
==> Installing Cask orbstack
==> Moving App 'OrbStack.app' to '/Applications/OrbStack.app'
==> Linking Binary 'orb' to '/usr/local/bin/orb'
==> Linking Binary 'orbctl' to '/usr/local/bin/orbctl'
🍺  orbstack was successfully installed!

可以看到,涉及到orbstack二进制文件 orb orbctl

3.打开orbstack

ad57261a3be2ded3ea51e02606535188.png

orbctl help

Use and manage OrbStack and its machines.

➜  joplin-blog git:(main) ✗ orbctl -h
Use and manage OrbStack and its machines.

The listed commands can be used with either "orbctl" or "orb".

You can also prefix commands with "orb" to run them on Linux. For example:
    orb uname -a
will run "uname -a" on macOS, and is equivalent to:
    orbctl run uname -a

In this mode, the default user and machine will be used.

Usage:
  orbctl [command]

Available Commands:
  completion  Generate completion script
  config      Change OrbStack settings
  create      Create a new machine
  debug       Debug a Docker container with extra commands
  default     Get or set the default machine
  delete      Delete a machine
  docker      Show commands for using Docker
  help        Help about any command
  info        Get info about a machine
  k8s         Show commands for using Kubernetes
  list        List machines
  login       Log in and activate your OrbStack license
  logout      Log out of your OrbStack account
  logs        Show logs for a machine
  migrate     Migrate data from Docker Desktop to OrbStack
  pull        Copy files from Linux
  push        Copy files to Linux
  rename      Rename a machine
  report      Gather info for a bug report
  reset       Delete all Linux and Docker data
  restart     Restart a machine
  run         Run command on Linux
  ssh         Show SSH details
  start       Start OrbStack or a machine
  status      Check whether OrbStack is running
  stop        Stop OrbStack or a machine
  update      Update OrbStack
  version     Show OrbStack version

Flags:
  -h, --help   help for orbctl

orbstack存储二进制文件

➜  joplin-blog git:(main) ✗ whereis docker
docker: /usr/local/bin/docker
➜  joplin-blog git:(main) ✗ 
➜  joplin-blog git:(main) ✗ readlink /usr/local/bin/docker
/Applications/OrbStack.app/Contents/MacOS/xbin/docker
➜  joplin-blog git:(main) ✗ ll /Applications/OrbStack.app/Contents/MacOS/xbin
total 428192
-rwxr-xr-x@ 1 mvpbang  staff  39608672  1 21 17:15 docker
-rwxr-xr-x@ 1 mvpbang  staff  59098000  1 21 17:15 docker-buildx
-rwxr-xr-x@ 1 mvpbang  staff  65571840  1 21 17:15 docker-compose
-rwxr-xr-x@ 1 mvpbang  staff   1928288  1 21 17:15 docker-credential-osxkeychain
-rwxr-xr-x@ 1 mvpbang  staff  53016000  1 21 17:15 kubectl
➜  joplin-blog git:(main) ✗ 

orb help

➜  ~ orb --help
OrbStack's short "orb" command can be used in 3 ways:

1. Start a Linux shell.
   Just run "orb" with no arguments.
   Usage: orb

2. Run commands on Linux, like "orbctl run".
   Prefix any command with "orb" to run it in Linux.
   Usage: orb [flags] <command> [args...]
   Example: orb uname -a

   The default user and machine will be used, unless specified with flags.
   For example, to log in to "ubuntu" as root: orb -m ubuntu -u root uname -a

   Use "orbctl run --help" for a list of flags.
   If you prefer SSH, use "orbctl ssh" for details.

3. Control Linux machines, like "orbctl".
   Start, stop, and manage OrbStack and its machines with any "orbctl" subcommand.
   Usage: orb <subcommand> [args...]

   Use "orbctl --help" for a list of subcommands.

For Docker containers, use the "docker" command. "orb" is for managing OrbStack and machines.
➜  ~ orb
mvpbang@ubuntu:/Users/mvpbang$ ls