Documentation
¶
Index ¶
- type API
- func (api *API) Build(project types.Project) (types.Service, error)
- func (api *API) BuildImage(tarFile string, tag string, labels map[string]string) error
- func (api *API) Call(file string, param string, project types.Project) error
- func (api *API) ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition, ...) (<-chan container.ContainerWaitOKBody, <-chan error)
- func (api *API) CreateNetwork(name string) error
- func (api *API) Down(names []string) error
- func (api *API) GetNetwork(name string) ([]dockerTypes.NetworkResource, error)
- func (api *API) List(name string) error
- func (api *API) Run(port int, service *types.Service) error
- func (api *API) Stop(name string) error
- func (api *API) Up(opt UpOptions) error
- type ContainerCreateRequestPayload
- type UpOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API interact with dockerd http api
func MustCreate ¶
MustCreate a api object, panic if not
func (*API) BuildImage ¶
BuildImage build docker image
func (*API) ContainerWait ¶
func (api *API) ContainerWait( ctx context.Context, containerID string, condition container.WaitCondition, timeout time.Duration, ) (<-chan container.ContainerWaitOKBody, <-chan error)
ContainerWait waits until the specified container is in a certain state indicated by the given condition, either "not-running" (default), "next-exit", or "removed".
If this client's API version is before 1.30, condition is ignored and ContainerWait will return immediately with the two channels, as the server will wait as if the condition were "not-running".
If this client's API version is at least 1.30, ContainerWait blocks until the request has been acknowledged by the server (with a response header), then returns two channels on which the caller can wait for the exit status of the container or an error if there was a problem either beginning the wait request or in getting the response. This allows the caller to synchronize ContainerWait with other calls, such as specifying a "next-exit" condition before issuing a ContainerStart request.
func (*API) CreateNetwork ¶
CreateNetwork create a network
func (*API) GetNetwork ¶
func (api *API) GetNetwork(name string) ([]dockerTypes.NetworkResource, error)
GetNetwork get a network
type ContainerCreateRequestPayload ¶
type ContainerCreateRequestPayload struct { *container.Config HostConfig *container.HostConfig NetworkingConfig *network.NetworkingConfig }
ContainerCreateRequestPayload request paylaod