Skip to content

LinuxKit

Build and publish bootable Linux images for VMs, bare metal, and cloud platforms.

Configuration

yaml
publishers:
  - type: linuxkit
    config: .core/linuxkit/server.yml

Options

OptionDescriptionDefault
configLinuxKit YAML configRequired
formatsOutput formats[iso]
platformsTarget platformslinux/amd64
nameImage nameFrom config

Formats

FormatDescription
isoBootable ISO image
qcow2QEMU/KVM image
rawRaw disk image
vhdHyper-V image
vmdkVMware image
awsAWS AMI
gcpGoogle Cloud image
azureAzure VHD

Examples

ISO + QCOW2

yaml
publishers:
  - type: linuxkit
    config: .core/linuxkit/server.yml
    formats:
      - iso
      - qcow2
    platforms:
      - linux/amd64
      - linux/arm64

Cloud Images

yaml
publishers:
  - type: linuxkit
    config: .core/linuxkit/cloud.yml
    formats:
      - aws
      - gcp
      - azure

Multiple Configurations

yaml
publishers:
  - type: linuxkit
    config: .core/linuxkit/minimal.yml
    formats: [iso]
    name: myapp-minimal

  - type: linuxkit
    config: .core/linuxkit/full.yml
    formats: [iso, qcow2]
    name: myapp-full

LinuxKit Config

.core/linuxkit/server.yml:

yaml
kernel:
  image: linuxkit/kernel:5.15
  cmdline: "console=tty0"

init:
  - linuxkit/init:v0.8
  - linuxkit/runc:v0.8

onboot:
  - name: sysctl
    image: linuxkit/sysctl:v0.8
  - name: dhcpcd
    image: linuxkit/dhcpcd:v0.8
    command: ["/sbin/dhcpcd", "--nobackground", "-f", "/dhcpcd.conf"]

services:
  - name: myapp
    image: myapp:latest

files:
  - path: /etc/myapp/config.yaml
    contents: |
      server:
        port: 8080

Environment Variables

VariableDescription
AWS_ACCESS_KEY_IDAWS credentials (for AMI publishing)
AWS_SECRET_ACCESS_KEYAWS credentials
GOOGLE_APPLICATION_CREDENTIALSGCP credentials (for GCP publishing)
AZURE_CREDENTIALSAzure credentials (for Azure publishing)

Released under the EUPL-1.2 License.