Skip to content

Add FreeBSD Platform Support #316

@nayuta723

Description

@nayuta723

Overview

Add FreeBSD Platform Support

Implement the FreeBSD-specific specification:

  • Add FreeBSD struct including devices and jail configuration
  • Implement FreeBSDJail, FreeBSDJailAllow, and related types

Runtime Spec Reference

Implemented in runtime-spec as follows:

Found in https://github.com/opencontainers/runtime-spec/blob/main/specs-go/config.go:

FreeBSDJailAllow

// FreeBSDJailAllow describes jail capabilities
type FreeBSDJailAllow struct {
	SetHostname   bool     `json:"setHostname,omitempty"`
	RawSockets    bool     `json:"rawSockets,omitempty"`
	Chflags       bool     `json:"chflags,omitempty"`
	Mount         []string `json:"mount,omitempty"`
	Quotas        bool     `json:"quotas,omitempty"`
	SocketAf      bool     `json:"socketAf,omitempty"`
	Mlock         bool     `json:"mlock,omitempty"`
	ReservedPorts bool     `json:"reservedPorts,omitempty"`
	Suser         bool     `json:"suser,omitempty"`
}

FreeBSDJail

// FreeBSDJail describes how to configure the container's jail
type FreeBSDJail struct {
	// Parent jail name - this can be used to share a single vnet
	// across several containers
	Parent string `json:"parent,omitempty"`
	// Whether to use parent UTS names or override in the container
	Host FreeBSDSharing `json:"host,omitempty"`
	// IPv4 address sharing for the container
	Ip4 FreeBSDSharing `json:"ip4,omitempty"`
	// IPv4 addresses for the container
	Ip4Addr []string `json:"ip4Addr,omitempty"`
	// IPv6 address sharing for the container
	Ip6 FreeBSDSharing `json:"ip6,omitempty"`
	// IPv6 addresses for the container
	Ip6Addr []string `json:"ip6Addr,omitempty"`
	// Which network stack to use for the container
	Vnet FreeBSDSharing `json:"vnet,omitempty"`
	// If set, Ip4Addr and Ip6Addr addresses will be added to this interface
	Interface string `json:"interface,omitempty"`
	// List interfaces to be moved to the container's vnet
	VnetInterfaces []string `json:"vnetInterfaces,omitempty"`
	// SystemV IPC message sharing for the container
	SysVMsg FreeBSDSharing `json:"sysvmsg,omitempty"`
	// SystemV semaphore message sharing for the container
	SysVSem FreeBSDSharing `json:"sysvsem,omitempty"`
	// SystemV memory sharing for the container
	SysVShm FreeBSDSharing `json:"sysvshm,omitempty"`
	// Mount visibility (see jail(8) for details)
	EnforceStatfs *int `json:"enforceStatfs,omitempty"`
	// Jail capabilities
	Allow *FreeBSDJailAllow `json:"allow,omitempty"`
}

FreeBSD

// FreeBSD contains platform-specific configuration for FreeBSD based containers.
type FreeBSD struct {
	// Devices which are accessible in the container
	Devices []FreeBSDDevice `json:"devices,omitempty"`
	// Jail definition for this container
	Jail *FreeBSDJail `json:"jail,omitempty"`
}

Related to #309

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions