commands

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCommand

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

func (*AddCommand) CreatedBy

func (a *AddCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config

func (*AddCommand) ExecuteCommand

func (a *AddCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand executes the ADD command Special stuff about ADD:

  1. If <src> is a remote file URL: - destination will have permissions of 0600 - If remote file has HTTP Last-Modified header, we set the mtime of the file to that timestamp - If dest doesn't end with a slash, the filepath is inferred to be <dest>/<filename>
  2. If <src> is a local tar archive: -If <src> is a local tar archive, it is unpacked at the dest, as 'tar -x' would

func (*AddCommand) FilesToSnapshot

func (a *AddCommand) FilesToSnapshot() []string

FilesToSnapshot should return an empty array if still nil; no files were changed

type ArgCommand

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

func (*ArgCommand) CreatedBy

func (r *ArgCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*ArgCommand) ExecuteCommand

func (r *ArgCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand only needs to add this ARG key/value as seen

func (*ArgCommand) FilesToSnapshot

func (r *ArgCommand) FilesToSnapshot() []string

FilesToSnapshot returns an empty array since this command only touches metadata.

type CmdCommand

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

func (*CmdCommand) CreatedBy

func (c *CmdCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*CmdCommand) ExecuteCommand

func (c *CmdCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand executes the CMD command Argument handling is the same as RUN.

func (*CmdCommand) FilesToSnapshot

func (c *CmdCommand) FilesToSnapshot() []string

FilesToSnapshot returns an empty array since this is a metadata command

type CopyCommand

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

func (*CopyCommand) CreatedBy

func (c *CopyCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config

func (*CopyCommand) ExecuteCommand

func (c *CopyCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*CopyCommand) FilesToSnapshot

func (c *CopyCommand) FilesToSnapshot() []string

FilesToSnapshot should return an empty array if still nil; no files were changed

type DockerCommand

type DockerCommand interface {
	// ExecuteCommand is responsible for:
	// 	1. Making required changes to the filesystem (ex. copying files for ADD/COPY or setting ENV variables)
	//  2. Updating metadata fields in the config
	// It should not change the config history.
	ExecuteCommand(*v1.Config, *dockerfile.BuildArgs) error
	// The config history has a "created by" field, should return information about the command
	CreatedBy() string
	// A list of files to snapshot, empty for metadata commands or nil if we don't know
	FilesToSnapshot() []string
}

func GetCommand

func GetCommand(cmd instructions.Command, buildcontext string) (DockerCommand, error)

type EntrypointCommand

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

func (*EntrypointCommand) CreatedBy

func (e *EntrypointCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*EntrypointCommand) ExecuteCommand

func (e *EntrypointCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand handles command processing similar to CMD and RUN,

func (*EntrypointCommand) FilesToSnapshot

func (e *EntrypointCommand) FilesToSnapshot() []string

FilesToSnapshot returns an empty array since this is a metadata command

type EnvCommand

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

func (*EnvCommand) CreatedBy

func (e *EnvCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*EnvCommand) ExecuteCommand

func (e *EnvCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*EnvCommand) FilesToSnapshot

func (e *EnvCommand) FilesToSnapshot() []string

We know that no files have changed, so return an empty array

type ExposeCommand

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

func (*ExposeCommand) CreatedBy

func (r *ExposeCommand) CreatedBy() string

func (*ExposeCommand) ExecuteCommand

func (r *ExposeCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*ExposeCommand) FilesToSnapshot

func (r *ExposeCommand) FilesToSnapshot() []string

type HealthCheckCommand

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

func (*HealthCheckCommand) CreatedBy

func (h *HealthCheckCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*HealthCheckCommand) ExecuteCommand

func (h *HealthCheckCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand handles command processing similar to CMD and RUN,

func (*HealthCheckCommand) FilesToSnapshot

func (h *HealthCheckCommand) FilesToSnapshot() []string

FilesToSnapshot returns an empty array since this is a metadata command

type LabelCommand

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

func (*LabelCommand) CreatedBy

func (r *LabelCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*LabelCommand) ExecuteCommand

func (r *LabelCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*LabelCommand) FilesToSnapshot

func (r *LabelCommand) FilesToSnapshot() []string

No files have changed, this command only touches metadata.

type OnBuildCommand

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

func (*OnBuildCommand) CreatedBy

func (o *OnBuildCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*OnBuildCommand) ExecuteCommand

func (o *OnBuildCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand adds the specified expression in Onbuild to the config

func (*OnBuildCommand) FilesToSnapshot

func (o *OnBuildCommand) FilesToSnapshot() []string

FilesToSnapshot returns that no files have changed, this command only touches metadata.

type RunCommand

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

func (*RunCommand) CreatedBy

func (r *RunCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config

func (*RunCommand) ExecuteCommand

func (r *RunCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*RunCommand) FilesToSnapshot

func (r *RunCommand) FilesToSnapshot() []string

FilesToSnapshot returns nil for this command because we don't know which files have changed, so we snapshot the entire system.

type ShellCommand

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

func (*ShellCommand) CreatedBy

func (s *ShellCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*ShellCommand) ExecuteCommand

func (s *ShellCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand handles command processing similar to CMD and RUN,

func (*ShellCommand) FilesToSnapshot

func (s *ShellCommand) FilesToSnapshot() []string

FilesToSnapshot returns an empty array since this is a metadata command

type StopSignalCommand

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

func (*StopSignalCommand) CreatedBy

func (s *StopSignalCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*StopSignalCommand) ExecuteCommand

func (s *StopSignalCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

ExecuteCommand handles command processing similar to CMD and RUN,

func (*StopSignalCommand) FilesToSnapshot

func (s *StopSignalCommand) FilesToSnapshot() []string

FilesToSnapshot returns an empty array since this is a metadata command

type UserCommand

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

func (*UserCommand) CreatedBy

func (r *UserCommand) CreatedBy() string

func (*UserCommand) ExecuteCommand

func (r *UserCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*UserCommand) FilesToSnapshot

func (r *UserCommand) FilesToSnapshot() []string

type VolumeCommand

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

func (*VolumeCommand) CreatedBy

func (v *VolumeCommand) CreatedBy() string

func (*VolumeCommand) ExecuteCommand

func (v *VolumeCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*VolumeCommand) FilesToSnapshot

func (v *VolumeCommand) FilesToSnapshot() []string

type WorkdirCommand

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

func (*WorkdirCommand) CreatedBy

func (w *WorkdirCommand) CreatedBy() string

CreatedBy returns some information about the command for the image config history

func (*WorkdirCommand) ExecuteCommand

func (w *WorkdirCommand) ExecuteCommand(config *v1.Config, buildArgs *dockerfile.BuildArgs) error

func (*WorkdirCommand) FilesToSnapshot

func (w *WorkdirCommand) FilesToSnapshot() []string

FilesToSnapshot returns the workingdir, which should have been created if it didn't already exist

Jump to

Keyboard shortcuts

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