reverse

package
v0.0.0-...-b60b6a8 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateFromInfo

func GenerateFromInfo(location string,
	volumes map[string]struct{},
	workingDir string,
	env []string,
	labels map[string]string,
	user string,
	exposedPorts map[docker.Port]struct{},
	entrypoint []string,
	cmd []string,
	hasData bool,
	tarData bool) error

GenerateFromInfo builds and saves a Dockerfile file object

func SaveDockerfileData

func SaveDockerfileData(fatImageDockerfileLocation string, fatImageDockerfileLines []string) error

SaveDockerfileData saves the Dockerfile information to a file

Types

type Dockerfile

type Dockerfile struct {
	Lines           []string
	Maintainers     []string
	AllUsers        []string
	ExeUser         string
	ExposedPorts    []string
	ImageStack      []*ImageInfo
	AllInstructions []*InstructionInfo
	HasOnbuild      bool
}

Dockerfile represents the reverse engineered Dockerfile info

func DockerfileFromHistory

func DockerfileFromHistory(apiClient *docker.Client, imageID string) (*Dockerfile, error)

DockerfileFromHistory recreates Dockerfile information from container image history

type ImageInfo

type ImageInfo struct {
	IsTopImage   bool               `json:"is_top_image"`
	ID           string             `json:"id"`
	FullName     string             `json:"full_name"`
	RepoName     string             `json:"repo_name"`
	VersionTag   string             `json:"version_tag"`
	RawTags      []string           `json:"raw_tags,omitempty"`
	CreateTime   string             `json:"create_time"`
	NewSize      int64              `json:"new_size"`
	NewSizeHuman string             `json:"new_size_human"`
	BaseImageID  string             `json:"base_image_id,omitempty"`
	Instructions []*InstructionInfo `json:"instructions"`
}

type InstructionInfo

type InstructionInfo struct {
	Type string `json:"type"`
	Time string `json:"time"`
	//Time              time.Time `json:"time"`
	IsLastInstruction   bool     `json:"is_last_instruction,omitempty"`
	IsNop               bool     `json:"is_nop"`
	IsExecForm          bool     `json:"is_exec_form,omitempty"` //is exec/json format (a valid field for RUN, ENTRYPOINT, CMD)
	LocalImageExists    bool     `json:"local_image_exists"`
	IntermediateImageID string   `json:"intermediate_image_id,omitempty"`
	LayerIndex          int      `json:"layer_index"` //-1 for an empty layer
	LayerID             string   `json:"layer_id,omitempty"`
	LayerFSDiffID       string   `json:"layer_fsdiff_id,omitempty"`
	Size                int64    `json:"size"`
	SizeHuman           string   `json:"size_human,omitempty"`
	Params              string   `json:"params,omitempty"`
	CommandSnippet      string   `json:"command_snippet"`
	CommandAll          string   `json:"command_all"`
	SystemCommands      []string `json:"system_commands,omitempty"`
	Comment             string   `json:"comment,omitempty"`
	Author              string   `json:"author,omitempty"`
	EmptyLayer          bool     `json:"empty_layer,omitempty"`

	RawTags    []string `json:"raw_tags,omitempty"`
	Target     string   `json:"target,omitempty"`      //for ADD and COPY
	SourceType string   `json:"source_type,omitempty"` //for ADD and COPY
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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