Buat dan kelola VM alpine ringan di macOS dengan:
? Penerusan port yang mulus
Berbagi File Otomatis
? Jaringan Jembatan
emulasi aarch64 dan x86_64

Tujuan dari proyek ini adalah untuk memungkinkan pengguna MacOS untuk:
macpine dimaksudkan untuk digunakan pada macOS modern. Dukungan untuk versi MacOS yang lebih lama dan OS lainnya dapat bervariasi.
brew install macpine # installs `alpine` command and `qemu` dependency automatically Unduh rilis biner terbaru untuk sistem Anda dan tambahkan ke $PATH Anda dengan memindahkannya ke EG /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 tergantung pada qemu> = 7.22.0:
brew install qemu Anda juga dapat menginstal macpine melalui MacPorts:
sudo port install macpine Bangunan dari sumber membutuhkan go compiler yang berfungsi, dan berlari membutuhkan 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/pathUntuk membuat dan memulai contoh baru:
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 defaultsContoh akses melalui 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)Ekspos port instance tambahan ke host:
# 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 Contoh dapat dengan mudah dikemas untuk cadangan atau berbagi sebagai file .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 Ini akan membuat file cheerful-result.tar.gz yang dapat diimpor sebagai:
# alpine delete cheerful-result
alpine import cheerful-result.tar.gzLihat semua dokumen untuk informasi lebih lanjut:
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. Beberapa contoh dalam sebuah perintah: beberapa perintah ( delete , edit , info , pause , publish , restart , resume , start , stop ) Terima beberapa nama instance dan akan mengulangi operasi di setiap instance unik bernama sekali.
Tag: Menggunakan alpine tag , instance dapat ditandai; Tag dapat digunakan dalam perintah multi-instance (lihat di atas) misalnya alpine start +foobar akan memulai semua contoh yang telah ditandai foobar dengan alpine tag instance-name foobar . Perhatikan bahwa tag launchctl-autostart digunakan untuk instance yang memulai secara otomatis saat login.
Shell AutoCompletion: File Penyelesaian Perintah Shell (diinstal secara otomatis dengan brew install macpine ) dapat dihasilkan dengan alpine completion [bash|zsh|fish|powershell] . Lihat alpine completion -h atau dokumentasi penyelesaian untuk informasi lebih lanjut.