cmd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use: "executor",
	PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
		if err := util.SetLogLevel(logLevel); err != nil {
			return err
		}
		if err := resolveSourceContext(); err != nil {
			return err
		}
		return checkDockerfilePath()
	},
	Run: func(cmd *cobra.Command, args []string) {
		if !checkContained() {
			if !force {
				logrus.Error("kaniko should only be run inside of a container, run with the --force flag if you are sure you want to continue.")
				os.Exit(1)
			}
			logrus.Warn("kaniko is being run outside of a container. This can have dangerous effects on your system")
		}
		if err := os.Chdir("/"); err != nil {
			logrus.Error(err)
			os.Exit(1)
		}
		ref, image, err := executor.DoBuild(dockerfilePath, srcContext, snapshotMode, buildArgs)
		if err != nil {
			logrus.Error(err)
			os.Exit(1)
		}
		if err := executor.DoPush(ref, image, destination, tarPath); err != nil {
			logrus.Error(err)
			os.Exit(1)
		}
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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