Documentation ¶
Index ¶
- Constants
- func EnvVar(key string) string
- func EnvVarInDocker(key string) string
- func GetDockerfileTemplate(d Dockerfile) string
- type DockerCompose
- type Dockerfile
- func (d Dockerfile) AddContent(from string, to string) *Dockerfile
- func (d Dockerfile) AddEnv(key string, value string) *Dockerfile
- func (d Dockerfile) AddLabel(label string, content string) *Dockerfile
- func (d *Dockerfile) String() string
- func (d Dockerfile) WithCmd(cmd ...string) *Dockerfile
- func (d Dockerfile) WithExpose(exposes ...string) *Dockerfile
- func (d Dockerfile) WithVolume(volumes ...string) *Dockerfile
- func (d Dockerfile) WithWorkDir(dir string) *Dockerfile
- type Image
- type Link
- type MaybeListString
- type Port
- type Protocol
- type Service
- func (service Service) AddDns(dns string, dnsSearch string) *Service
- func (service Service) AddExternalLink(s string, host string) *Service
- func (service Service) AddLink(s string, host string) *Service
- func (service Service) AddROVolume(nameOrLocalPath string, mountPath string) *Service
- func (service Service) AddRWVolume(nameOrLocalPath string, mountPath string) *Service
- func (service Service) AddTCPPort(port int16, containerPort int16) *Service
- func (service Service) AddUDPPort(port int16, containerPort int16) *Service
- func (service Service) AddVolumeFrom(name string, accessMode VolumeAccessMode) *Service
- func (service Service) EnableTTY() *Service
- func (service Service) Merge(nextService *Service) *Service
- func (service Service) SetCommand(commands ...string) *Service
- func (service Service) SetEnvironment(key string, value string) *Service
- func (service Service) SetLabel(key string, value string) *Service
- func (service Service) WithImage(image string) *Service
- type Services
- type Volume
- func (v Volume) IsMountFromLocal() bool
- func (v Volume) IsMountFromStorage() bool
- func (v Volume) IsProvider() bool
- func (v Volume) MarshalYAML() (interface{}, error)
- func (v Volume) ReadOnly() bool
- func (v Volume) String() string
- func (v *Volume) UnmarshalYAML(unmarshal func(interface{}) error) error
- type VolumeAccessMode
Constants ¶
View Source
const ( VolumeAccessModeReadWrite = "rw" VolumeAccessModeReadOnly = "ro" )
Variables ¶
This section is empty.
Functions ¶
func EnvVarInDocker ¶
func GetDockerfileTemplate ¶
func GetDockerfileTemplate(d Dockerfile) string
Types ¶
type DockerCompose ¶
type DockerCompose struct { Version string `yaml:"version"` Services Services `yaml:"services,omitempty"` }
func NewDockerCompose ¶
func NewDockerCompose() *DockerCompose
func (DockerCompose) AddService ¶
func (dc DockerCompose) AddService(name string, s *Service) *DockerCompose
type Dockerfile ¶
type Dockerfile struct { From string `docker:"FROM" yaml:"from,omitempty"` Image string `yaml:"image"` Label map[string]string `docker:"LABEL,multi" yaml:"label,omitempty"` Run string `docker:"RUN,inline" yaml:"run,omitempty"` WorkDir string `docker:"WORKDIR" yaml:"workdir,omitempty"` Env map[string]string `docker:"ENV,multi" yaml:"env,omitempty"` Add map[string]string `docker:"ADD,join" yaml:"add,omitempty"` Expose []string `docker:"EXPOSE" yaml:"expose,omitempty"` Volume []string `docker:"VOLUME,array" yaml:"volume,omitempty"` Cmd []string `docker:"CMD,array" yaml:"cmd,omitempty"` EntryPoint []string `docker:"ENTRYPOINT,array" yaml:"entrypoint,omitempty"` }
func (Dockerfile) AddContent ¶
func (d Dockerfile) AddContent(from string, to string) *Dockerfile
func (Dockerfile) AddEnv ¶
func (d Dockerfile) AddEnv(key string, value string) *Dockerfile
func (Dockerfile) AddLabel ¶
func (d Dockerfile) AddLabel(label string, content string) *Dockerfile
func (*Dockerfile) String ¶
func (d *Dockerfile) String() string
func (Dockerfile) WithCmd ¶
func (d Dockerfile) WithCmd(cmd ...string) *Dockerfile
func (Dockerfile) WithExpose ¶
func (d Dockerfile) WithExpose(exposes ...string) *Dockerfile
func (Dockerfile) WithVolume ¶
func (d Dockerfile) WithVolume(volumes ...string) *Dockerfile
func (Dockerfile) WithWorkDir ¶
func (d Dockerfile) WithWorkDir(dir string) *Dockerfile
type MaybeListString ¶
type MaybeListString struct {
// contains filtered or unexported fields
}
func MaybeListStringFromStringList ¶
func MaybeListStringFromStringList(list ...string) MaybeListString
func (MaybeListString) IsZero ¶
func (v MaybeListString) IsZero() bool
func (MaybeListString) MarshalYAML ¶
func (v MaybeListString) MarshalYAML() (interface{}, error)
func (*MaybeListString) UnmarshalYAML ¶
func (v *MaybeListString) UnmarshalYAML(unmarshal func(interface{}) error) error
func (MaybeListString) Value ¶
func (v MaybeListString) Value() []string
type Service ¶
type Service struct { Image Image `yaml:"image"` EntryPoint MaybeListString `yaml:"entrypoint,omitempty"` Command MaybeListString `yaml:"command,omitempty"` Labels map[string]string `yaml:"labels,omitempty"` Environment map[string]string `yaml:"environment,omitempty"` Ports []Port `yaml:"ports,omitempty"` Links []Link `yaml:"links,omitempty"` ExternalLinks []Link `yaml:"external_links,omitempty"` Volumes []Volume `yaml:"volumes,omitempty"` VolumesFrom []Volume `yaml:"volumes_from,omitempty"` WorkingDir string `yaml:"working_dir,omitempty"` DnsSearch []string `yaml:"dns_search,omitempty"` Dns []string `yaml:"dns,omitempty"` TTY *bool `yaml:"tty,omitempty"` MemLimit *int64 `yaml:"mem_limit,omitempty"` MemSwapLimit *int64 `yaml:"memswap_limit,omitempty"` MemReservation *int64 `yaml:"mem_reservation,omitempty"` }
func NewService ¶
func (Service) AddExternalLink ¶
func (Service) AddROVolume ¶
func (Service) AddRWVolume ¶
func (Service) AddTCPPort ¶
func (Service) AddUDPPort ¶
func (Service) AddVolumeFrom ¶
func (service Service) AddVolumeFrom(name string, accessMode VolumeAccessMode) *Service
func (Service) SetCommand ¶
func (Service) SetEnvironment ¶
type Services ¶
func (*Services) UnmarshalYAML ¶
type Volume ¶
type Volume struct { Name string LocalPath string MountPath string AccessMode VolumeAccessMode }
func ParseVolumeString ¶
func (Volume) IsMountFromLocal ¶
func (Volume) IsMountFromStorage ¶
func (Volume) IsProvider ¶
func (Volume) MarshalYAML ¶
func (*Volume) UnmarshalYAML ¶
type VolumeAccessMode ¶
type VolumeAccessMode string
Click to show internal directories.
Click to hide internal directories.