build

package
v0.0.0-...-efcb13b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BaseKernelOptions = map[string]string{
	"CONFIG_BINFMT_ELF":                   "y",
	"CONFIG_BLOCK":                        "y",
	"CONFIG_BLK_DEV":                      "y",
	"CONFIG_BRIDGE":                       "y",
	"CONFIG_BRIDGE_NETFILTER":             "y",
	"CONFIG_BRIDGE_VLAN_FILTERING":        "y",
	"CONFIG_CPUSETS":                      "y",
	"CONFIG_CGROUPS":                      "y",
	"CONFIG_CGROUP_BPF":                   "y",
	"CONFIG_CGROUP_CPUACCT":               "y",
	"CONFIG_CGROUP_DEVICE":                "y",
	"CONFIG_CGROUP_FREEZER":               "y",
	"CONFIG_CGROUP_PIDS":                  "y",
	"CONFIG_CGROUP_SCHED":                 "y",
	"CONFIG_INET_ESP":                     "m",
	"CONFIG_IPC_NS":                       "y",
	"CONFIG_IP_NF_FILTER":                 "y",
	"CONFIG_IP_NF_NAT":                    "y",
	"CONFIG_IP_NF_TARGET_MASQUERADE":      "y",
	"CONFIG_IP_VALN":                      "m",
	"CONFIG_IP_VS":                        "m",
	"CONFIG_IP_VS_RR":                     "y",
	"CONFIG_KEYS":                         "y",
	"CONFIG_MACVLAN":                      "m",
	"CONFIG_MEMCG":                        "y",
	"CONFIG_MEMCG_SWAP":                   "y",
	"CONFIG_MODULES":                      "y",
	"CONFIG_NAMESPACES":                   "y",
	"CONFIG_NET":                          "y",
	"CONFIG_NETFILTER_XT_MATCH_ADDRTYPE":  "y",
	"CONFIG_NETFILTER_XT_MATCH_CONNTRACK": "y",
	"CONFIG_NETFILTER_XT_MATCH_IPVS":      "y",
	"CONFIG_NETFILTER_XT_MARK":            "y",
	"CONFIG_NETDEVICES":                   "y",
	"CONFIG_NET_CORE":                     "y",
	"CONFIG_NET_NS":                       "y",
	"CONFIG_OVERLAY_FS":                   "m",
	"CONFIG_PID_NS":                       "y",
	"CONFIG_POSIX_MQUEUE":                 "y",
	"CONFIG_TTY":                          "y",
	"CONFIG_UTS_NS":                       "y",
	"CONFIG_USER_NS":                      "y",
	"CONFIG_VETH":                         "y",
	"CONFIG_VXLAN":                        "m",
	"CONFIG_XFRM":                         "y",
	"CONFIG_9P_FS":                        "y",
	"CONFIG_DEBUG_KERNEL":                 "y",
	"CONFIG_DRM_VIRTIO_GPU":               "y",
	"CONFIG_HYPERVISOR_GUEST":             "y",
	"CONFIG_INET":                         "y",
	"CONFIG_IP_PNP":                       "y",
	"CONFIG_IP_PNP_DHCP":                  "y",
	"CONFIG_KVM_GUEST":                    "y",
	"CONFIG_NET_9P":                       "y",
	"CONFIG_NET_9P_VIRTIO":                "y",
	"CONFIG_NETWORK_FILESYSTEMS":          "y",
	"CONFIG_PCI":                          "y",
	"CONFIG_PCI_MSI":                      "y",
	"CONFIG_PARAVIRT":                     "y",
	"CONFIG_S390_GUEST":                   "y",
	"CONFIG_SCSCI_LOWLEVEL":               "y",
	"CONFIG_SCSCI_VIRTIO":                 "y",
	"CONFIG_SERIAL_8250":                  "y",
	"CONFIG_SERIAL_8250_CONSOLE":          "y",
	"CONFIG_VIRTUALIZATION":               "y",
	"CONFIG_VIRTIO":                       "y",
	"CONFIG_VIRTIO_BLK":                   "y",
	"CONFIG_VIRTIO_CONSOLE":               "y",
	"CONFIG_VIRTIO_INPUT":                 "y",
	"CONFIG_VIRTIO_MENU":                  "y",
	"CONFIG_VIRTIO_NET":                   "y",
}

BaseKernelOptions are used when building the kernel w/o a custom config. We take the minimal `tinyconfig` and add these on top.

View Source
var DockerdInitScriptName = "/usr/local/bin/dockerd-init"
View Source
var GoImageRef = "golang:1.20"
View Source
var JammyRef = "ubuntu:jammy"
View Source
var MobyKernelMods = []string{
	"br_netfilter",
	"ip_conntrack",
	"ip_tables",
	"ipt_conntrack",
	"ipt_MASQUERADE",
	"ipt_REJECT",
	"ipt_state",
	"iptable_filter",
	"iptable_nat",
	"overlay",
	"nf_conntrack",
	"nf_conntrack_netlink",
	"xt_addrtype",
	"xt_u32",
	"veth",
}
View Source
var MobyRef = "docker:23-dind"
View Source
var UseMergeOp = true

Functions

func BuildKernel

func BuildKernel(container llb.State, source File, config *File) (kernelCfg File, vmlinuz File, modules Directory)

func GetMoby

func GetMoby(ref string) (llb.State, error)

func GoFSToLLB

func GoFSToLLB(fs gofs.FS, rewrite RewriteFn) (llb.State, error)

GoFSToDagger converts a gofs.FS to llb state.

func JammyRootfs

func JammyRootfs() llb.State

func KernelBuildBase

func KernelBuildBase() llb.State

func Mod

func Mod(modSource llb.State, name, p, target string) llb.State

func QemuBase

func QemuBase() llb.State

Types

type Directory

type Directory struct {
	// contains filtered or unexported fields
}

func NewDirectory

func NewDirectory(st llb.State, p string) Directory

func (Directory) CopyTo

func (d Directory) CopyTo(st llb.State) llb.State

func (Directory) IsEmpty

func (d Directory) IsEmpty() bool

func (Directory) Path

func (d Directory) Path() string

func (Directory) State

func (d Directory) State() llb.State

func (Directory) Target

func (d Directory) Target() string

func (Directory) WithTarget

func (d Directory) WithTarget(target string) Directory

type DiskImageSpec

type DiskImageSpec struct {
	Kernel Kernel
	Rootfs llb.State
	Size   int64
}

func (*DiskImageSpec) Build

func (s *DiskImageSpec) Build() File

type File

type File struct {
	// contains filtered or unexported fields
}

func DockerdInitScript

func DockerdInitScript() File

func GetKernelSource

func GetKernelSource(version string) (File, error)

func NewFile

func NewFile(st llb.State, p string) File

func QcowDiff

func QcowDiff(qcow File) File

func QcowFrom

func QcowFrom(rootfs llb.State, size int64) File

func (File) CopyTo

func (f File) CopyTo(st llb.State) llb.State

func (File) IsEmpty

func (f File) IsEmpty() bool

func (File) Path

func (f File) Path() string

func (File) State

func (f File) State() llb.State

func (File) Target

func (f File) Target() string

func (File) WithTarget

func (f File) WithTarget(target string) File

type Kernel

type Kernel struct {
	Initrd  File
	Kernel  File
	Modules Directory
	Config  File
}

type KernelVersion

type KernelVersion struct {
	Major int
	Minor int
	Patch int
	RC    int
	IsRC  bool
}

func ParseKernelVersion

func ParseKernelVersion(version string) (KernelVersion, error)

type RewriteFn

type RewriteFn func(string) string

RewriteFn is a function that can be used to rewrite the path of a file or directory It is used by GoFSToDagger to allow callers to pass in a function that can rewrite the path.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL