// PlatformAdd build and push a new docker platform to register
PlatformAdd build and push a new docker platform to register
// PlatformAdd build and push a new docker platform to register
func (p *dockerProvisioner) PlatformAdd(name string, args map[string]string, w io.Writer) error {
	if args["dockerfile"] == "" {
		return errors.New("Dockerfile is required.")
	}
	if _, err := url.ParseRequestURI(args["dockerfile"]); err != nil {
		return errors.New("dockerfile parameter should be an url.")
	}
	imageName := assembleImageName(name)
	dockerCluster := dockerCluster()
	buildOptions := docker.BuildImageOptions{
		Name:           imageName,
		NoCache:        true,
		RmTmpContainer: true,
		Remote:         args["dockerfile"],
		InputStream:    nil,
		OutputStream:   w,
	}
	err := dockerCluster.BuildImage(buildOptions)
	if err != nil {
		return err
	}
	return pushImage(imageName)
}
func ( p * dockerProvisioner ) PlatformAdd ( name string , args map [ string ] string , w io . Writer ) error { if args [ " " ] == " " { return errors . New ( " " ) } if _ , err := url . ParseRequestURI ( args [ " " ] ) ; err != nil { return errors . New ( " " ) } imageName := assembleImageName ( name ) dockerCluster := dockerCluster ( ) buildOptions := docker . BuildImageOptions { Name : imageName , NoCache : true , RmTmpContainer : true , Remote : args [ " " ] , InputStream : nil , OutputStream : w , } err := dockerCluster . BuildImage ( buildOptions ) if err != nil { return err } return pushImage ( imageName ) }
PlatformAdd build and push a new docker platform to register
PlatformAdd build and push a new docker platform to register