Documentation ¶
Index ¶
- Constants
- func BaseInvocationImage(cli command.Cli) string
- func CheckAppVersion(stderr io.Writer, bndl *bundle.Bundle) error
- func CustomPayload(b *bundle.Bundle) (interface{}, error)
- func Extract(name string, ops ...func(*types.App) error) (*types.App, error)
- func ExtractCNABParametersValues(mapping CNABParametersMapping, env []string) map[string]string
- func GetNamedTagged(tag string) (reference.NamedTagged, error)
- func Init(errWriter io.Writer, name string, composeFile string) (string, error)
- func MakeBundleFromApp(dockerCli command.Cli, app *types.App, refOverride reference.NamedTagged) (*bundle.Bundle, error)
- func MakeCNABImageName(appName, appVersion, suffix string) (string, error)
- func MakeInvocationImageName(meta metadata.AppMetadata, refOverride reference.NamedTagged) (string, error)
- func PackInvocationImageContext(cli command.Cli, app *types.App, target io.Writer) error
- func PersistInImageStore(ref reference.Reference, bndl *bundle.Bundle) (reference.Digested, error)
- func ToCNAB(app *types.App, invocationImageName string) (*bundle.Bundle, error)
- type CNABParametersMapping
- type CustomPayloadAppVersion
- type DockerAppArgs
- type DockerAppCustom
Constants ¶
const ( // DockerAppCustomVersion1_0_0 is the custom payload version 1.0.0 DockerAppPayloadVersion1_0_0 = "1.0.0" // DockerAppCustomVersionCurrent the current payload version // The version must be bumped each time the Payload format change. DockerAppPayloadVersionCurrent = DockerAppPayloadVersion1_0_0 )
const (
// CNABVersion1_0_0 is the CNAB Schema version 1.0.0
CNABVersion1_0_0 = "v1.0.0"
)
const (
// DefaultCNABBaseImageName is the name of the default base invocation image.
DefaultCNABBaseImageName = "docker/cnab-app-base"
)
Variables ¶
This section is empty.
Functions ¶
func BaseInvocationImage ¶ added in v0.8.0
BaseInvocationImage returns the name and tag of the CNAB base invocation image
func CheckAppVersion ¶
CheckAppVersion prints a warning if the bundle was built with a different version of docker app
func CustomPayload ¶
CustomPayload parses and returns the bundle's custom payload
func Extract ¶
Extract extracts the app content if argument is an archive, or does nothing if a dir. It returns source file, effective app name, and cleanup function If appname is empty, it looks into cwd, and all subdirs for a single matching .dockerapp If nothing is found, it looks for an image and loads it
func ExtractCNABParametersValues ¶ added in v0.8.0
func ExtractCNABParametersValues(mapping CNABParametersMapping, env []string) map[string]string
ExtractCNABParametersValues extracts the parameter values from the given CNAB environment
func GetNamedTagged ¶
func GetNamedTagged(tag string) (reference.NamedTagged, error)
func Init ¶
Init is the entrypoint initialization function. It generates a new application definition based on the provided parameters and returns the path to the created application definition.
func MakeBundleFromApp ¶
func MakeCNABImageName ¶
func MakeInvocationImageName ¶
func MakeInvocationImageName(meta metadata.AppMetadata, refOverride reference.NamedTagged) (string, error)
func PackInvocationImageContext ¶ added in v0.8.0
PackInvocationImageContext creates a Docker build context for building a CNAB invocation image
func PersistInImageStore ¶
PersistInImageStore do store a bundle with optional reference and return it's ID
Types ¶
type CNABParametersMapping ¶ added in v0.8.0
type CNABParametersMapping struct { CNABEnvToParameter map[string]string ParameterToCNABEnv map[string]string }
CNABParametersMapping describes the desired mapping between parameters and CNAB environment variables
func ExtractCNABParameterMapping ¶ added in v0.8.0
func ExtractCNABParameterMapping(parameters parameters.Parameters) CNABParametersMapping
ExtractCNABParameterMapping extracts the CNABParametersMapping from application parameters
type CustomPayloadAppVersion ¶
type CustomPayloadAppVersion interface {
AppVersion() string
}
CustomPayloadAppVersion is a custom payload with a docker app version
type DockerAppArgs ¶
type DockerAppArgs struct { // Labels are the labels to add to containers on run Labels map[string]string `json:"labels,omitempty"` }
DockerAppArgs represent the object passed to the invocation image by Docker App.
type DockerAppCustom ¶
type DockerAppCustom struct { // Payload format version Version string `json:"version,omitempty"` // Custom payload format depends on version Payload json.RawMessage `json:"payload,omitempty"` }
DockerAppCustom contains extension custom data that docker app injects in the bundle.