Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

petr-korobeinikov/multipass-compose

Repository files navigation

No Maintenance Intended

multipass-compose

Compose multipass™ virtual machines like a ... charm!

Deprecation warning

Multipass is a buggy and inconvenient project to manage virtual machines with Ubuntu. So this project is now deprecated. Think about using lima/colima instead which is more powerful and truly supported by community.

Install

go install github.com/petr-korobeinikov/multipass-compose/cmd/multipass-compose@latest

TL;DR

  1. Define your multipass-compose.yaml:

    services:
      web-server:
        image: focal
      database:
        image: focal
      backend:
        image: focal
  2. Start machines up:

    multipass-compose up
  3. Check the status:

    multipass-compose status
  4. Do the job 🛠️ 🪚 🔨 🔧

  5. Turn machines off:

    multipass-compose down

Command reference

multipass-compose up          # Starts machines up
multipass-compose down        # Turns machines down
multipass-compose status      # Shows machines status
multipass-compose ip <name>   # Shows IPv4 address of given machine

multipass-compose.yaml reference

services: # Defines a list of services
  lb: # Custom machine name
    image: focal # Ubuntu release, see `multipass find`
    cpus: 1 # Number of CPUs to allocate.
    mem: 1G # Amount of memory to allocate. Positive integers, in bytes, or with K, M, G suffix.
    disk: 5G # Disk space to allocate. Positive integers, in bytes, or with K, M, G suffix.
    cloud-init: path/to/cloud/config.yaml # Path or URL to a user-data cloud-init configuration.
  database:
    image: focal
    cpus: 4
    mem: 4G
    disk: 80G
  backend:
    image: focal
    cpus: 2
    mem: 2G
    disk: 20G

A complete list of examples you can find out in this repo.

Development

bats helpers installed as git submodules. To fetch them out use:

git submodule update --init --recursive

Releases

No releases published

Packages

No packages published