types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ImageVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	Version     int            `json:"version"`
	ImageConfig v1.ImageConfig `json:"image-config"`
	Layers      []Layer        `json:"layers"`
	Arch        string         `json:"arch"`
}

Image represent the JSON image file produced by nix2container. This JSON file can then be used by the Skopeo Nix transport to actually build the container image.

type Layer

type Layer struct {
	Digest  string `json:"digest"`
	Size    int64  `json:"size"`
	DiffIDs string `json:"diff_ids"`
	Paths   Paths  `json:"paths,omitempty"`
	// OCI mediatype
	// https://github.com/opencontainers/image-spec/blob/8b9d41f48198a7d6d0a5c1a12dc2d1f7f47fc97f/specs-go/v1/mediatype.go
	MediaType string `json:"mediatype"`
	LayerPath string `json:"layer-path,omitempty"`
}

func NewLayersFromFile

func NewLayersFromFile(filename string) ([]Layer, error)

type Path

type Path struct {
	Path    string       `json:"path"`
	Options *PathOptions `json:"options,omitempty"`
}

type PathOptions

type PathOptions struct {
	Rewrite Rewrite `json:"rewrite,omitempty"`
	Perms   []Perm  `json:"perms,omitempty"`
}

type Paths

type Paths []Path

type Perm

type Perm struct {
	Regex string `json:"regex"`
	// Octal representation of file permissions
	Mode  string `json:"mode"`
	Uid   int    `json:"uid"`
	Gid   int    `json:"gid"`
	Uname string `json:"uname"`
	Gname string `json:"gname"`
}

type PermPath

type PermPath struct {
	Path  string `json:"path"`
	Regex string `json:"regex"`
	// Octal representation of file permissions
	Mode  string `json:"mode"`
	Uid   int    `json:"uid"`
	Gid   int    `json:"gid"`
	Uname string `json:"uname"`
	Gname string `json:"gname"`
}

type Rewrite

type Rewrite struct {
	Regex string `json:"regex"`
	Repl  string `json:"repl"`
}

type RewritePath

type RewritePath struct {
	Path  string `json:"path"`
	Regex string `json:"regex"`
	Repl  string `json:"repl"`
}

RewritePath describes how to replace the Regex in Path by the replacement Repl.

This allows to rewrite storepaths during the tar operation. This is mainly used to move storepaths from the /nix/store to / in the image.

Jump to

Keyboard shortcuts

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