Coder Social home page Coder Social logo

mikdusan / macpine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from beringresearch/macpine

0.0 1.0 0.0 411 KB

Lightweight Linux VMs on MacOS

Home Page: https://beringresearch.github.io/macpine/

License: Apache License 2.0

Shell 3.78% Go 95.40% Makefile 0.83%

macpine's Introduction

Go Report Card

Lightweight Alpine VMs on MacOS

Create and manage lightweight Alpine VMs on MacOS with:

๐Ÿ” Seamless port forwarding

๐Ÿ—‚๏ธ Automatic file sharing

๐ŸŽข Bridged networking

๐Ÿš€ aarch64 and x86_64 emulation

Motivation

The goal of this project is to enable MacOS users to:

  1. Easily spin up and manage lightweight Alpine Linux environments.
  2. Use tiny VMs to take advantage of containerisation technologies, including LXD and Docker.
  3. Build and test software on x86_64 and aarch64 systems.

Installation

Macpine depends on QEMU >= 6.2.0_1:

#brew update
#brew upgrade
brew install qemu

Install the latest binary

Download the latest binary release for your system and add it to your path by placing to e.g. /usr/local/bin/:

wget https://github.com/beringresearch/macpine/releases/download/v.06/alpine_darwin_arm64
mv alpine_darwin_arm64 alpine
sudo chmod +x alpine
sudo mv alpine /usr/local/bin/

Install from source

git clone https://github.com/beringresearch/macpine
cd macpine
make

Install from MacPorts

On macOS, you can install via MacPorts:

sudo port install macpine

See more information here.

Getting Started

To launch a brand new VM:

alpine launch #launches with default parameters
alpine launch -a aarch64 #create an aarch64 instance
alpine launch -d 10G -c 4 -m 2048 #create a machine with a 10GB disk, 4 cpus and 2GB of RAM

Access VM via ssh:

alpine launch -s 22 #launch a VM and expose SSH port to host port 22
ssh root@localhost -p 22 #password: root

Expose additional VM ports to host:

alpine launch -s 23 -p 8888,5432 #launch a VM, expose SSH to host port 23 and forward VM ports 8888 and 5432 to host ports 8888 and 5432

VMs can be easily packaged for export and re-use as tar.gz files:

alpine list

NAME                STATUS      SSH    PORTS ARCH        PID 
forthright-hook     Running     23           aarch64     91598
hot-cow             Running     22           x86_64      82361
alpine publish hot-cow

This will create a file hot-cow.tar.gz which can be imported as:

alpine import hot-cow.tar.gz

Command Reference

Create, control and connect to Alpine instances.

Usage:
  alpine [command]

Available Commands:
  delete      Delete an instance.
  edit        Edit instance configuration using Vim.
  exec        execute COMMAND over ssh.
  help        Help about any command
  import      Imports an instance.
  info        Display information about instances.
  launch      Launch an Alpine instance.
  list        List all available instances.
  publish     Publish an instance.
  ssh         Attach an interactive shell to an instance.
  start       Start an instance.
  stop        Stop an instance.

Flags:
  -h, --help   help for alpine

Use "alpine [command] --help" for more information about a command.

macpine's People

Contributors

brandonros avatar bunam avatar gpanders avatar herbygillot avatar idroz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.