Перейти к файлу
Tonis Tiigi a4ec5b48ec Change missing image detection for create
Daemon may not respond with the same image name
any more but it may be in a normalized form.
Generally checking for a container name doesn’t 
seem like a good idea because small image names
may match any possible error.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-01-11 12:05:28 -08:00
client Change missing image detection for create 2016-01-11 12:05:28 -08:00
types Merge pull request #29 from mavenugo/netdisconnect 2016-01-11 11:08:13 -08:00
.travis.yml Turn email notifications off. 2016-01-04 18:51:18 -05:00
CHANGELOG.md Add changelog for version 0.2.0. 2016-01-11 14:50:49 -05:00
CONTRIBUTING.md Add contributing document. 2016-01-07 19:19:09 -05:00
LICENSE Add changelog file. 2016-01-06 15:11:32 -05:00
MAINTAINERS Add project structure. 2016-01-04 17:58:04 -05:00
README.md Add godoc reference link. 2016-01-04 18:41:39 -05:00
doc.go Add project structure. 2016-01-04 17:58:04 -05:00

README.md

GoDoc

Introduction

Engine-api is a set of Go libraries to implement client and server components compatible with the Docker engine. The code was extracted from the Docker engine and contributed back as an external library.

Components

Client

The client package implements a fully featured http client to interact with the Docker engine. It's modeled after the requirements of the Docker engine CLI, but it can also serve other purposes.

Usage

You can use this client package in your applications by creating a new client object. Then use that object to execute operations against the remote server. Follow the example below to see how to list all the containers running in a Docker engine host:

package main

import (
	"fmt"
	"github.com/docker/engine-api/client"
	"github.com/docker/engine-api/types"
)

func main() {
	defaultHeaders := map[string]string{"User-Agent": "engine-api-cli-1.0"}
	cli, err := client.NewClient("unix:///var/run/docker.sock", "v1.22", nil, defaultHeaders)
	if err != nil {
		panic(err)
	}

	options := types.ContainerListOptions{All: true}
	containers, err := cli.ContainerList(options)
	if err != nil {
		panic(err)
	}

	for _, c := range containers {
		fmt.Println(c.ID)
	}
}

Types

The types package includes all typed structures that client and server serialize to execute operations.

Server

The server package includes API endpoints that applications compatible with the Docker engine API can reuse. It also provides useful middlewares and helpers to handle http requests.

This package is still pending to be extracted from the Docker engine.

License

engine-api is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.