使用以下方式創建和管理輕巧的高山VMS:
?無縫端口轉發
自動文件共享
?橋接網絡
aarch64和x86_64仿真

該項目的目的是使MacOS用戶能夠:
macpine旨在用於現代MacOS。對MACOS和其他OS的較舊版本的支持可能會有所不同。
brew install macpine # installs `alpine` command and `qemu` dependency automatically 下載最新的系統二進製版本,並通過將其移動到EG/ $PATH /usr/local/bin/ :
arch= " $( [ ` uname -m ` = ' x86_64 ' ] && echo ' amd64 ' || echo ' arm64 ' ) " # detect architecture
wget " https://github.com/beringresearch/macpine/releases/latest/download/alpine_darwin_ $arch "
mv " alpine_darwin_ $arch " alpine
sudo chmod +x alpine
sudo mv alpine /usr/local/bin/
# export PATH="$PATH:/usr/local/bin"Macpine取決於QEMU> = 7.22.0:
brew install qemu您也可以通過Macports安裝macpine :
sudo port install macpine從源構建需要一個工作的go編譯器,並且運行需要qemu :
brew install go qemu
git clone https://github.com/beringresearch/macpine
cd macpine
make # compiles the project into a local bin/ directory
make install # installs binaries to /usr/local/bin
# PREFIX=/some/other/path make install installs to /some/other/path創建並啟動一個新實例:
alpine launch # launches with default parameters
alpine launch -a aarch64 # create an aarch64 instance
alpine launch -d 10G -c 4 -m 2048 # create an instance with a 10GB disk, 4 cpus, and 2GB of RAM
alpine launch -h # view all configuration options and defaults通過SSH訪問實例:
alpine launch -s 22 # launch an instance and expose SSH port to host port 22
alpine ssh instance-name # attach shell to instance (replace `instance-name` as appropriate)將其他實例端口暴露到主機:
# launch an instance, expose SSH to host port 2022 and forward host ports 8888 and 5432 to instance ports 8888 and 5432
alpine launch -s 2022 -p 8888,5432
# launch an instance, expose SSH to host port 8022, forward host port 8081 to instance port 8082, and forward
# host port 8083 to instance port 8083
alpine launch -s 8022 -p 8081:8082,8083
# launch an instance, expose SSH to host port 9022, forward host port 9091 UDP to instance port 9091 UDP,
# and forward host port 9092 UDP to instance port 9093 UDP
alpine launch -s 9023 -p 9091u,9092:9093u實例可以輕鬆打包以備份或共享為.tar.gz文件:
alpine list
NAME STATUS SSH PORTS ARCH PID TAGS
cheerful-result Running 2022 aarch64 26568
glittering-swing Running 3022 x86_64 57206 emulation,intelalpine publish cheerful-result這將創建一個File cheerful-result.tar.gz ,可以將其導入為:
# alpine delete cheerful-result
alpine import cheerful-result.tar.gz有關更多信息,請參見所有文檔:
Create, control, and connect to Alpine instances.
Usage:
alpine [command]
Available Commands:
completion Generate shell autocompletions.
delete Delete instances.
edit Edit instance configurations.
exec execute a command on an instance over ssh.
help Help about any command
import Imports an instance archived with `alpine publish`.
info Display information about instances.
launch Create and start an instance.
list List instances.
pause Pause instances.
publish Publish instances.
rename Rename an instance.
restart Stop and start instances.
resume Unpause instances.
ssh Attach an interactive shell to an instance via ssh.
start Start instances.
stop Stop instances.
tag Add or remove tags from an instance.
Flags:
-h, --help help for alpine
Use "alpine [command] --help" for more information about a command.命令中的多個實例:某些命令( delete , edit , info , pause , publish , restart , resume , start , stop )接受多個實例名稱,並將在每個唯一命名的實例上重複一次操作。
標籤:使用alpine tag ,可以標記實例;標籤可以在多實施命令中使用(請參見上文),例如alpine start +foobar將啟動所有已使用alpine tag instance-name foobar foobar為Foobar的實例。請注意,TAG launchctl-autostart用於在登錄時自動啟動實例。
外殼自動完成:可以使用alpine completion [bash|zsh|fish|powershell]生成外殼命令完成文件(使用brew install macpine自動安裝)。有關更多信息,請參見alpine completion -h或完成文檔。