Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hhstore opened this issue Sep 10, 2023 · 8 comments
Open

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

hhstore opened this issue Sep 10, 2023 · 8 comments

Comments

@hhstore
Copy link
Owner

hhstore commented Sep 10, 2023

📖 Abstract:

  • ✅ Orbstack: MacOS 平台上 Docker/VirtualBox 替代品.

💯 Related:

@hhstore
Copy link
Owner Author

hhstore commented Sep 10, 2023

Orbstack: MacOS 上的 Docker 最佳替代品

Orbstack 核心功能:

  • 完美替代 docker.
  • 支持创建 k8s 本地集群.
  • 快速创建 虚拟机, 非常容易管理虚拟机文件目录.

Orbstack 安装:

brew install orbstack

Orbstack 配置:

  • 更改虚拟机共享的 CPU 和 内存.
  • 如果机器配置低, 建议只给 1C + 4GB.
image

创建 Linux 虚拟机:

  • 通常常用的虚拟机开发环境:
  • debain12: 默认预装 python3.11
  • Ubuntu 20.04.6 LTS: 默认预装 python3.8
image

进入虚拟机:

  • GUI 方式: 右键.
image
  • 命令行方式: 设置默认虚拟机. mac终端内, 执行:
# mac 终端内: 只能打开默认的一个. 
orb

@hhstore
Copy link
Owner Author

hhstore commented Sep 10, 2023

Orbstack 创建虚拟机

创建+配置 Ubuntu 20.04.6 LTS 教程:

  • 创建虚拟机 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
Copy link
Owner Author

hhstore commented Sep 10, 2023

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

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

Linux 虚拟机 用户设置:

  • 使用默认开发用户进行安装即可.
  • 设置 root 密码:
passwd root
# 输入密码


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

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

Linux 虚拟机 设置环境变量:

@hhstore
Copy link
Owner Author

hhstore commented Sep 10, 2023

debain12 虚拟机中安装 mojo:

  • ✅ 有坑, 不要使用. 请使用 Ubuntu 20.04.6 LTS 来安装 mojo.
  • ✅ 进入虚拟机, orbstack 可以创建多个虚拟机. 需要指定默认.
# 进入虚拟机环境:
orb
  • 虚拟机 OS 环境信息:
# 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
Copy link
Owner Author

hhstore commented Sep 10, 2023

1

3 similar comments
@hhstore
Copy link
Owner Author

hhstore commented Sep 10, 2023

1

@hhstore
Copy link
Owner Author

hhstore commented Sep 10, 2023

1

@hhstore
Copy link
Owner Author

hhstore commented Sep 10, 2023

1

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

No branches or pull requests

1 participant