docker

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compose

type Compose struct {
	Version     string
	Services    map[string]interface{}
	Networks    map[string]interface{}
	Volumes     map[string]interface{}
	ServiceKeys []string `yaml:"-"`
	NetworkKeys []string `yaml:"-"`
	VolumeKeys  []string `yaml:"-"`
}

Compose is abstraction for docker-compose.yml

func NewCompose

func NewCompose(version string) *Compose

NewCompose return new instance of DockerCompose

func (*Compose) RegisterNetwork

func (d *Compose) RegisterNetwork(name string, network interface{}) *Compose

RegisterNetwork to register network

func (*Compose) RegisterService

func (d *Compose) RegisterService(name string, service interface{}) *Compose

RegisterService to register service

func (*Compose) RegisterVolume

func (d *Compose) RegisterVolume(name string, volume interface{}) *Compose

RegisterVolume to register volume

type Network

type Network struct {
	Driver string `yaml:"driver,omitempty"`
}

Network in docker-compose.yaml

type Service

type Service struct {
	Image       string            `yaml:"image,omitempty"`
	Command     string            `yaml:"command,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty"`
	Volumes     []string          `yaml:"volumes,omitempty"`
	Ports       []string          `yaml:"ports,omitempty"`
	Networks    []string          `yaml:"networks,omitempty"`
	Restart     string            `yaml:"restart,omitempty"`
}

Service in docker-compose.yaml

Jump to

Keyboard shortcuts

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