cli

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: Apache-2.0 Imports: 29 Imported by: 0

README

Makisu Usage Information


$ makisu --help
Usage of makisu:
  -cpu-profile
    	Profile the application. (type: bool, default: false)
  -help
    	Display usage information for Makisu. (type: bool, default: false)
  -log-fmt
    	The format of the logs. (type: string, default: "json")
  -log-level
    	The level at which to log. (type: string, default: "info")
  -log-output
    	The output file path for the logs. (type: string, default: "stdout")

Sub-Commands:
  build  |  Builds a docker image from a build context and a dockerfile.

$ makisu build --help
Usage of makisu build:
  -blacklist
    	Comma separated list of files/directories. Makisu will omit all changes to these locations in the resulting docker images. (type: string, default: "")
  -build-args
    	Arguments to the dockerfile as per the spec of ARG. Format is a json object. (type: map, default: {})
  -cache-ttl
    	The TTL of cacheID-sha mapping entries in seconds. (type: int, default: 604800)
  -commit
    	Set to explicit to only commit at steps with '#!COMMIT' annotations; Set to implicit to commit at every ADD/COPY/RUN step. (type: string, default: "implicit")
  -compression
    	Image compression level, could be 'no', 'speed', 'size', 'default'. (type: string, default: "default")
  -dest
    	Destination of the image tar. (type: string, default: "")
  -docker-host
    	Docker host to load images to. (type: string, default: "unix:///var/run/docker.sock")
  -docker-scheme
    	Scheme for api calls to docker daemon. (type: string, default: "http")
  -docker-version
    	Version string for loading images to docker. (type: string, default: "1.21")
  -f	The absolute path to the dockerfile (type: string, default: "Dockerfile")
  -load
    	Load image after build. (type: bool, default: false)
  -modifyfs
    	Allow makisu to touch files outside of its own storage dir. (type: bool, default: false)
  -push
    	Push image after build to the comma-separated list of registries. (type: string, default: "")
  -redis-cache-addr
    	The address of a redis cache server for cacheID to layer sha mapping. (type: string, default: "")
  -registry-config
    	Registry configuration file for pulling and pushing images. Default configuration for DockerHub is used if not specified. (type: string, default: "")
  -storage
    	Directory that makisu uses for temp files and cached layers. Mount this path for better caching performance. If modifyfs is set, default to /makisu-storage; Otherwise default to /tmp/makisu-storage. (type: string, default: "")
  -t	image tag (required) (type: string, default: "")

$ makisu version
v0.1.2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationFlags

type ApplicationFlags struct {
	HelpFlag  bool   `commander:"flag=help,Display usage information for Makisu."`
	LogOutput string `commander:"flag=log-output,The output file path for the logs."`
	LogLevel  string `commander:"flag=log-level,The level at which to log."`
	LogFormat string `commander:"flag=log-fmt,The format of the logs."`

	Profile bool `commander:"flag=cpu-profile,Profile the application."`
}

ApplicationFlags contains all of the flags for the top level CLI app.

type BuildApplication

type BuildApplication struct {
	ApplicationFlags `commander:"flagstruct"`
	BuildFlags       `commander:"flagstruct=build"`
	// contains filtered or unexported fields
}

BuildApplication contains the bindings for the `makisu build` command.

func NewBuildApplication

func NewBuildApplication() *BuildApplication

NewBuildApplication returns a new instance of application. The version of the application is used as a seed to any cache ID computation, so different versions will result in a break of caching layers.

func (*BuildApplication) AddCleanup

func (app *BuildApplication) AddCleanup(fn func() error)

AddCleanup adds a cleanup function to run after the application exits.

func (*BuildApplication) CLIName

func (app *BuildApplication) CLIName() string

CLIName returns the name of the application. Commander uses this when showing usage information.

func (*BuildApplication) Cleanup

func (app *BuildApplication) Cleanup() error

Cleanup cleans up the application after it has run its command.

func (*BuildApplication) CommanderDefault added in v0.1.1

func (app *BuildApplication) CommanderDefault() error

CommanderDefault gets called automatically when no subcommand is invoked.

func (*BuildApplication) GetCommandDescription

func (app *BuildApplication) GetCommandDescription(cmd string) string

GetCommandDescription returns the description of the given application command. This is used by commander when displaying the help messages.

func (*BuildApplication) Help

func (app *BuildApplication) Help()

Help displays the usage of makisu.

func (*BuildApplication) PostFlagParse

func (app *BuildApplication) PostFlagParse() error

PostFlagParse initializes the standard logger and sets up profiling if need be. This implements the commander.PostFlagParseHook interface, so this function will get called after the Application struct gets injected with the values taken from the flags and arguments of the CLI; but before any of the Build/Pull (etc...) functions get called.

func (*BuildApplication) Version added in v0.1.1

func (app *BuildApplication) Version() error

Version displays the version of the makisu binary in use.

type BuildFlags

type BuildFlags struct {
	DockerfilePath string `commander:"flag=f,The absolute path to the dockerfile"`
	Tag            string `commander:"flag=t,image tag (required)"`

	Arguments      map[string]string `commander:"flag=build-args,Arguments to the dockerfile as per the spec of ARG. Format is a json object."`
	Destination    string            `commander:"flag=dest,Destination of the image tar."`
	PushRegistries string            `commander:"flag=push,Push image after build to the comma-separated list of registries."`
	RegistryConfig string            `` /* 154-byte string literal not displayed */

	AllowModifyFS bool   `commander:"flag=modifyfs,Allow makisu to touch files outside of its own storage dir."`
	Commit        string `` /* 146-byte string literal not displayed */
	Blacklist     string `` /* 149-byte string literal not displayed */

	DockerHost    string `commander:"flag=docker-host,Docker host to load images to."`
	DockerVersion string `commander:"flag=docker-version,Version string for loading images to docker."`
	DockerScheme  string `commander:"flag=docker-scheme,Scheme for api calls to docker daemon."`
	DoLoad        bool   `commander:"flag=load,Load image after build."`

	RedisCacheAddress   string `commander:"flag=redis-cache-addr,The address of a redis cache server for cacheID to layer sha mapping."`
	CacheTTL            int    `commander:"flag=cache-ttl,The TTL of cacheID-sha mapping entries in seconds"`
	StorageDir          string `` /* 223-byte string literal not displayed */
	CompressionLevelStr string `commander:"flag=compression,Image compression level, could be 'no', 'speed', 'size', 'default'."`
	// contains filtered or unexported fields
}

BuildFlags contains all of the flags for `makisu build ...`

func (BuildFlags) Build

func (cmd BuildFlags) Build(contextDir string) error

Build image from the specified dockerfile. If -push is specified, will also push the image to those registries. If -load is specified, will load the image into the local docker daemon.

func (BuildFlags) GetTargetRegistries

func (cmd BuildFlags) GetTargetRegistries() []string

GetTargetRegistries returns the target registries that the image should be pushed to.

Jump to

Keyboard shortcuts

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