instruction

package
v0.0.0-...-1bc8c79 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package instruction describes the Docker instruction data model.

Index

Constants

View Source
const (
	Add         = "add"
	Arg         = "arg"
	Cmd         = "cmd"
	Copy        = "copy"
	Entrypoint  = "entrypoint"
	Env         = "env"
	Expose      = "expose"
	From        = "from"
	Healthcheck = "healthcheck"
	Label       = "label"
	Maintainer  = "maintainer"
	Onbuild     = "onbuild"
	Run         = "run"
	Shell       = "shell"
	StopSignal  = "stopsignal"
	User        = "user"
	Volume      = "volume"
	Workdir     = "workdir"
)

All supported instruction names

Variables

View Source
var Specs = map[string]Format{
	Add: {
		Name:             Add,
		SupportsFlags:    true,
		SupportsJSONForm: true,
	},
	Arg: {
		Name:               Arg,
		SupportsNameValues: true,
	},
	Cmd: {
		Name:             Cmd,
		SupportsJSONForm: true,
	},
	Copy: {
		Name:             Copy,
		SupportsFlags:    true,
		SupportsJSONForm: true,
	},
	Entrypoint: {
		Name:             Entrypoint,
		SupportsJSONForm: true,
	},
	Env: {
		Name:               Env,
		RequiresNameValues: true,
	},
	Expose: {
		Name: Expose,
	},
	From: {
		Name:          From,
		SupportsFlags: true,
	},
	Healthcheck: {
		Name:             Healthcheck,
		SupportsJSONForm: true,
	},
	Label: {
		Name:               Label,
		RequiresNameValues: true,
	},
	Maintainer: {
		Name:         Maintainer,
		IsDeprecated: true,
	},
	Onbuild: {
		Name:            Label,
		SupportsSubInst: true,
	},
	Run: {
		Name:             Run,
		SupportsJSONForm: true,
	},
	Shell: {
		Name:             Shell,
		SupportsJSONForm: true,
	},
	StopSignal: {
		Name: StopSignal,
	},
	User: {
		Name: User,
	},
	Volume: {
		Name:             Volume,
		SupportsJSONForm: true,
	},
	Workdir: {
		Name: Workdir,
	},
}

Specs is a map of all available instructions and their format info (by name)

Functions

func IsKnown

func IsKnown(name string) bool

func SupportsJSONForm

func SupportsJSONForm() []string

Types

type Field

type Field struct {
	GlobalIndex int      `json:"start_index"`
	StageIndex  int      `json:"stage_index"`
	StageID     int      `json:"stage_id"`
	RawData     string   `json:"-"`
	RawLines    []string `json:"raw_lines"`
	StartLine   int      `json:"start_line"`
	EndLine     int      `json:"end_line"`
	Name        string   `json:"name"`
	Flags       []string `json:"flags,omitempty"`
	Args        []string `json:"args,omitempty"`
	ArgsRaw     string   `json:"args_raw,omitempty"`
	IsJSONForm  bool     `json:"is_json"`
	IsOnBuild   bool     `json:"is_onbuild,omitempty"`
	IsValid     bool     `json:"is_valid"`
	Errors      []string `json:"errors,omitempty"`
}

type Format

type Format struct {
	Name               string
	SupportsFlags      bool //todo: add a list allowed flags
	SupportsJSONForm   bool
	SupportsNameValues bool
	RequiresNameValues bool
	SupportsSubInst    bool
	IsDeprecated       bool
}

Jump to

Keyboard shortcuts

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