hhstore / blog

My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
276 stars 22 forks source link

Orbstack(Mac + Docker) - Say goodbye to Docker #412

Open hhstore opened 9 months ago

hhstore commented 9 months ago

📖 Abstract:

💯 Related:

hhstore commented 9 months ago

Orbstack: MacOS 上的 Docker 最佳替代品

Orbstack 核心功能:

Orbstack 安装:


brew install orbstack

Orbstack 配置:

image

创建 Linux 虚拟机:

image

进入虚拟机:

image

# mac 终端内: 只能打开默认的一个. 
orb
hhstore commented 9 months ago

Orbstack 创建虚拟机

创建+配置 Ubuntu 20.04.6 LTS 教程:


$ uname -a
Linux ubuntu20 6.4.13-orbstack-00090-ga4cfdc88d4df #1 SMP Thu Aug 31 05:51:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:    20.04
Codename:   focal

$ whoami
geek  # 默认同 Mac宿主机 用户名

$ python -V
Python 3.8.10
# 进入虚拟机环境:
orb 

# 必装
sudo apt-get update \
    && sudo  apt-get install -y \
    git \
    zsh \
    software-properties-common \
    build-essential \
    curl \
    vim \
    python3 python3-pip

# 补充:
sudo ln -s /usr/bin/python3 /usr/bin/python

sudo apt-get install -y clang-14 lld-14
hhstore commented 9 months ago

Linux 虚拟机 配置 oh-my-zsh:


sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Linux 虚拟机 用户设置:

passwd root
# 输入密码

# 用户切换: (非必要)
su - root

# 再次安装一下 oh-my-zsh

Linux 虚拟机 设置环境变量:

hhstore commented 9 months ago

debain12 虚拟机中安装 mojo:


# 进入虚拟机环境:
orb

# OS 环境:
➜ uname -a
Linux debian12 6.4.13-orbstack-00090-ga4cfdc88d4df #1 SMP Thu Aug 31 05:51:21 UTC 2023 x86_64 GNU/Linux

➜ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 12 (bookworm)
Release:    12
Codename:   bookworm
hhstore commented 9 months ago

1

hhstore commented 9 months ago

1

hhstore commented 9 months ago

1

hhstore commented 9 months ago

1