DocsReleasesCommunityGuidesBlog

Unikraft Plugin for HashiCorp Packer

The plugin can be used with the Packer CLI to create highly customized and ultra-lightweight VMs. This integration with Unikraft enables developer experience towards seamlessly building your application as a unikernel.

To get started immediately, check out the repository README or see the installation instructions below.

Overview#

The plugin interfaces with the native Go API offered by KraftKit, Unikraft's command-line companion tool, to handle everything related to linking your application with Unikraft. Thanks to this interface, the plugin itself is kept light and modular.

The following minimalistic configuration allows you to build unikernel applications. For example building app-helloworld unikernel application:

source "unikraft-builder" "example" {
// Target architecture of the resulting VM binary
architecture = "x86_64"
// Target platform of the resulting VM binary
platform = "kvm"
// Path of the resulting binaries
build_path = "/tmp/my-packer-unikernel/.unikraft/apps/helloworld"
// Path where to pull the sources and build the binaries
workdir = "/tmp/my-packer-unikernel"
// Application to pull and build
pull_source = "helloworld"
// Extra sources to use for the application
sources = [
"https://github.com/unikraft/app-helloworld.git",
]
}

Installation#

Quickstart#

packer plugins install github.com/unikraft/unikraft

Using the packer init command#

Starting from Packer v1.7, plugins can be automatically installed via the packer init command. To install this plugin, copy and paste the following code snippet preamble into your Packer configuration file:

packer {
required_plugins {
unikraft = {
version = ">= 0.1.0"
source = "github.com/unikraft/packer-plugin-unikraft"
}
}
}

Manual installation#

You can find pre-built binary releases of the plugin here. Full installation instructions for installing plugins from source can be found on Packer's documentation.

Configuration#

For more information on how to configure the plugin, please read the documentation located in the docs/ directory.

Edit this page on GitHub

Connect with the community

Feel free to ask questions, report issues, and meet new people.

Join us on Discord!
®

Getting Started

What is a unikernel?Install CLI companion toolUnikraft InternalsRoadmap

© 2024  The Unikraft Authors. All rights reserved. Documentation distributed under CC BY-NC 4.0.