Documentation ¶
Index ¶
- Variables
- func HasImg() bool
- func TempDockerConfig(log hclog.Logger, target *Image, encodedAuth string) (string, error)
- type Builder
- type BuilderConfig
- type ClientConfig
- type Config
- type Deployment
- func (*Deployment) Descriptor() ([]byte, []int)deprecated
- func (x *Deployment) GetContainer() string
- func (x *Deployment) GetId() string
- func (x *Deployment) GetName() string
- func (*Deployment) ProtoMessage()
- func (x *Deployment) ProtoReflect() protoreflect.Message
- func (x *Deployment) Reset()
- func (x *Deployment) String() string
- type Image
- func (*Image) Descriptor() ([]byte, []int)deprecated
- func (x *Image) GetDocker() *empty.Empty
- func (x *Image) GetImage() string
- func (x *Image) GetImg() *empty.Empty
- func (m *Image) GetLocation() isImage_Location
- func (x *Image) GetRegistry() *empty.Empty
- func (x *Image) GetTag() string
- func (i *Image) Name() string
- func (*Image) ProtoMessage()
- func (x *Image) ProtoReflect() protoreflect.Message
- func (x *Image) Reset()
- func (x *Image) String() string
- type Image_Docker
- type Image_Img
- type Image_Registry
- type Platform
- func (p *Platform) Auth() error
- func (p *Platform) AuthFunc() interface{}
- func (p *Platform) Config() (interface{}, error)
- func (p *Platform) Deploy(ctx context.Context, log hclog.Logger, src *component.Source, ...) (*Deployment, error)
- func (p *Platform) DeployFunc() interface{}
- func (p *Platform) Destroy(ctx context.Context, log hclog.Logger, deployment *Deployment, ui terminal.UI) error
- func (p *Platform) DestroyFunc() interface{}
- func (p *Platform) Documentation() (*docs.Documentation, error)
- func (p *Platform) ValidateAuth() error
- func (p *Platform) ValidateAuthFunc() interface{}
- type PlatformConfig
- type Registry
- type Release
Constants ¶
This section is empty.
Variables ¶
var File_waypoint_builtin_docker_plugin_proto protoreflect.FileDescriptor
var Options = []sdk.Option{ sdk.WithComponents(&Builder{}, &Registry{}, &Platform{}), }
Options are the SDK options to use for instantiation.
Functions ¶
func HasImg ¶ added in v0.3.0
func HasImg() bool
HasImg returns true if "img" is available on the PATH.
This doesn't do any fancy checking that "img" is the "img" we expect. We can make the checking here more advanced later.
func TempDockerConfig ¶ added in v0.3.0
TempDockerConfig creates a new Docker configuration with the configured auth in it. It saves this Docker config to a temporary path and returns the path to that Docker file.
We have to do this because `img` doesn't support setting auth for a single operation. Therefore, we must set auth in the Docker config, but we don't want to pollute any concurrent runs or the main file. So we create a copy.
This can return ("", nil) if there is no custom Docker config necessary.
Callers should defer file deletion for this temporary file.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder uses `docker build` to build a Docker iamge.
func (*Builder) Build ¶
func (b *Builder) Build( ctx context.Context, ui terminal.UI, src *component.Source, log hclog.Logger, ) (*Image, error)
Build
func (*Builder) BuildFunc ¶
func (b *Builder) BuildFunc() interface{}
BuildFunc implements component.Builder
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"` // Controls whether or not the image should be build with buildkit or docker v1 UseBuildKit bool `hcl:"buildkit,optional"` // The name/path to the Dockerfile if it is not the root of the project Dockerfile string `hcl:"dockerfile,optional"` // Controls the passing of build time variables BuildArgs map[string]*string `hcl:"build_args,optional"` }
Config is the configuration structure for the registry.
type ClientConfig ¶ added in v0.1.3
type ClientConfig struct { // Host to use when connecting to Docker // This can be used to connect to remote Docker instances Host string `hcl:"host,optional"` // Path to load the certificates for the Docker Engine CertPath string `hcl:"cert_path,optional"` // Docker API version to use for connection APIVersion string `hcl:"api_version,optional"` }
type Config ¶
type Config struct { // Image is the name of the image plus tag that the image will be pushed as. Image string `hcl:"image,attr"` // Tag is the tag to apply to the image. Tag string `hcl:"tag,attr"` // Local if true will not push this image to a remote registry. Local bool `hcl:"local,optional"` // The docker specific encoded authentication string to use to talk to the registry. EncodedAuth string `hcl:"encoded_auth,optional"` }
Config is the configuration structure for the registry.
type Deployment ¶
type Deployment struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Container string `protobuf:"bytes,3,opt,name=container,proto3" json:"container,omitempty"` // contains filtered or unexported fields }
func (*Deployment) Descriptor
deprecated
func (*Deployment) Descriptor() ([]byte, []int)
Deprecated: Use Deployment.ProtoReflect.Descriptor instead.
func (*Deployment) GetContainer ¶
func (x *Deployment) GetContainer() string
func (*Deployment) GetId ¶
func (x *Deployment) GetId() string
func (*Deployment) GetName ¶
func (x *Deployment) GetName() string
func (*Deployment) ProtoMessage ¶
func (*Deployment) ProtoMessage()
func (*Deployment) ProtoReflect ¶ added in v0.3.0
func (x *Deployment) ProtoReflect() protoreflect.Message
func (*Deployment) Reset ¶
func (x *Deployment) Reset()
func (*Deployment) String ¶
func (x *Deployment) String() string
type Image ¶
type Image 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"` // location is where this image is currently. This can be used to // determine if the image is pulled or not based on this proto rather // than environment inspection. // // Types that are assignable to Location: // *Image_Registry // *Image_Docker // *Image_Img Location isImage_Location `protobuf_oneof:"location"` // contains filtered or unexported fields }
Image is the artifact type for the registry.
func (*Image) Descriptor
deprecated
func (*Image) GetLocation ¶ added in v0.3.0
func (m *Image) GetLocation() isImage_Location
func (*Image) GetRegistry ¶ added in v0.3.0
func (*Image) ProtoMessage ¶
func (*Image) ProtoMessage()
func (*Image) ProtoReflect ¶ added in v0.3.0
func (x *Image) ProtoReflect() protoreflect.Message
type Image_Docker ¶ added in v0.3.0
type Image_Img ¶ added in v0.3.0
type Image_Img struct { // img is set if the image is in a local img content store directory. // img: https://github.com/genuinetools/img Img *empty.Empty `protobuf:"bytes,5,opt,name=img,proto3,oneof"` }
type Image_Registry ¶ added in v0.3.0
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform is the Platform implementation for Docker.
func (*Platform) AuthFunc ¶
func (p *Platform) AuthFunc() interface{}
AuthFunc implements component.Authenticator
func (*Platform) Deploy ¶
func (p *Platform) Deploy( ctx context.Context, log hclog.Logger, src *component.Source, job *component.JobInfo, img *Image, deployConfig *component.DeploymentConfig, ui terminal.UI, ) (*Deployment, error)
Deploy deploys an image to Docker.
func (*Platform) DeployFunc ¶
func (p *Platform) DeployFunc() interface{}
DeployFunc implements component.Platform
func (*Platform) Destroy ¶
func (p *Platform) Destroy( ctx context.Context, log hclog.Logger, deployment *Deployment, ui terminal.UI, ) error
Destroy deletes a Docker deployment.
func (*Platform) DestroyFunc ¶
func (p *Platform) DestroyFunc() interface{}
DestroyFunc implements component.Destroyer
func (*Platform) Documentation ¶
func (p *Platform) Documentation() (*docs.Documentation, error)
func (*Platform) ValidateAuth ¶
func (*Platform) ValidateAuthFunc ¶
func (p *Platform) ValidateAuthFunc() interface{}
ValidateAuthFunc implements component.Authenticator
type PlatformConfig ¶
type PlatformConfig struct { // A list of folders to mount to the container. Binds []string `hcl:"binds,optional"` // ClientConfig allow the user to specify the connection to the Docker // engine. By default we try to load this from env vars: // DOCKER_HOST to set the url to the docker server. // DOCKER_API_VERSION to set the version of the API to reach, leave empty for latest. // DOCKER_CERT_PATH to load the TLS certificates from. // DOCKER_TLS_VERIFY to enable or disable TLS verification, off by default. ClientConfig *ClientConfig `hcl:"client_config,block"` // The command to run in the container. This is an array of arguments // that are executed directly. These are not executed in the context of // a shell. If you want to use a shell, add that to this command manually. Command []string `hcl:"command,optional"` // Force pull the image from the remote repository ForcePull bool `hcl:"force_pull,optional"` // A map of key/value pairs, stored in docker as a string. Each key/value pair must // be unique. Validiation occurs at the docker layer, not in Waypoint. Label // keys are alphanumeric strings which may contain periods (.) and hyphens (-). // See the docker docs for more info: https://docs.docker.com/config/labels-custom-metadata/ Labels map[string]string `hcl:"labels,optional"` // An array of strings with network names to connect the container to Networks []string `hcl:"networks,optional"` // A map of resources to configure the container with such as memory and cpu // limits. Resources map[string]string `hcl:"resources,optional"` // A path to a directory that will be created for the service to store // temporary data. ScratchSpace string `hcl:"scratch_path,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"` // Additional ports the application is listening on to expose on the container ExtraPorts []uint `hcl:"extra_ports,optional"` // Port that your service is running on within the actual container. // Defaults to port 3000. // TODO Evaluate if this should remain as a default 3000, should be a required field, // or default to another port. ServicePort uint `hcl:"service_port,optional"` }
Config is the configuration structure for the Platform.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry represents access to a Docker registry.
func (*Registry) Documentation ¶
func (r *Registry) Documentation() (*docs.Documentation, error)
type Release ¶
type Release struct { Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // contains filtered or unexported fields }
func (*Release) Descriptor
deprecated
func (*Release) ProtoMessage ¶
func (*Release) ProtoMessage()
func (*Release) ProtoReflect ¶ added in v0.3.0
func (x *Release) ProtoReflect() protoreflect.Message