pack

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: MPL-2.0 Imports: 31 Imported by: 0

README

Pack

The Pack plugin creates a Docker image using CloudNative Buildpacks.

Components

  1. Builder
  1. Docker

Documentation

Index

Constants

View Source
const DefaultBuilder = "heroku/buildpacks:20"
View Source
const (
	// This is legacy and comes from heroku, which cnb continued with.
	DefaultProcessType = "web"
)

Variables

View Source
var File_waypoint_builtin_pack_plugin_proto protoreflect.FileDescriptor
View Source
var Options = []sdk.Option{
	sdk.WithComponents(&Builder{}),
	sdk.WithMappers(PackImageMapper),
}

Options are the SDK options to use for instantiation.

Functions

func PackImageMapper

func PackImageMapper(src *DockerImage) *docker.Image

PackImageMapper maps a pack.DockerImage to our Image structure.

NOTE(mitchellh): the pack builder can probably just reuse the image from here but at the time of writing I was still building all the mapper subsystems so I wanted to test it out.

Types

type Builder

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

Builder uses `pack` -- the frontend for CloudNative Buildpacks -- to build an artifact from source.

func (*Builder) Build

func (b *Builder) Build(
	ctx context.Context,
	ui terminal.UI,
	jobInfo *component.JobInfo,
	src *component.Source,
	log hclog.Logger,
) (*DockerImage, error)

Build

func (*Builder) BuildFunc

func (b *Builder) BuildFunc() interface{}

BuildFunc implements component.Builder

func (*Builder) BuildODR added in v0.6.0

func (b *Builder) BuildODR(
	ctx context.Context,
	ui terminal.UI,
	jobInfo *component.JobInfo,
	src *component.Source,
	log hclog.Logger,
	ai *docker.AccessInfo,
) (*DockerImage, error)

Build

func (*Builder) BuildODRFunc added in v0.6.0

func (b *Builder) BuildODRFunc() interface{}

BuildFunc implements component.BuilderODR

func (*Builder) Config

func (b *Builder) Config() (interface{}, error)

Config implements Configurable

func (*Builder) Documentation

func (b *Builder) Documentation() (*docs.Documentation, error)

type BuilderConfig

type BuilderConfig struct {
	// Control whether or not to inject the entrypoint binary into the resulting image
	DisableCEB bool `hcl:"disable_entrypoint,optional"`

	// The Buildpack builder image to use, defaults to the standard heroku one.
	Builder string `hcl:"builder,optional"`

	// The exact buildpacks to use.
	Buildpacks []string `hcl:"buildpacks,optional"`

	// Environment variables that are meant to configure the application in a static
	// way. This might be control an image that has mulitple modes of operation,
	// selected via environment variable. Most configuration should use the waypoint
	// config commands.
	StaticEnvVars map[string]string `hcl:"static_environment,optional"`

	// Files patterns to prevent from being pulled into the build.
	Ignore []string `hcl:"ignore,optional"`

	// Process type that will be used when setting container start command.
	ProcessType string `hcl:"process_type,optional" default:"web"`
}

Config is the configuration structure for the registry.

type DockerImage

type DockerImage struct {
	Image       string            `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"`
	Tag         string            `protobuf:"bytes,2,opt,name=tag,proto3" json:"tag,omitempty"`
	BuildLabels map[string]string `` /* 182-byte string literal not displayed */
	Remote      bool              `protobuf:"varint,4,opt,name=remote,proto3" json:"remote,omitempty"`
	// contains filtered or unexported fields
}

DockerImage is the artifact type for the builder.

func (*DockerImage) Descriptor deprecated

func (*DockerImage) Descriptor() ([]byte, []int)

Deprecated: Use DockerImage.ProtoReflect.Descriptor instead.

func (*DockerImage) GetBuildLabels

func (x *DockerImage) GetBuildLabels() map[string]string

func (*DockerImage) GetImage

func (x *DockerImage) GetImage() string

func (*DockerImage) GetRemote added in v0.6.0

func (x *DockerImage) GetRemote() bool

func (*DockerImage) GetTag

func (x *DockerImage) GetTag() string

func (*DockerImage) Labels

func (i *DockerImage) Labels() map[string]string

func (*DockerImage) ProtoMessage

func (*DockerImage) ProtoMessage()

func (*DockerImage) ProtoReflect

func (x *DockerImage) ProtoReflect() protoreflect.Message

func (*DockerImage) Reset

func (x *DockerImage) Reset()

func (*DockerImage) String

func (x *DockerImage) String() string

Jump to

Keyboard shortcuts

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