Перейти к файлу
Vincent Demeester dea108d3aa
Add unit tests for ImagePull
It also updates `ImagePull` to not panic if no `PrivilegeFunc` are
passed in `ImagePullOptions`.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-05-09 19:00:47 +02:00
client Add unit tests for ImagePull 2016-05-09 19:00:47 +02:00
types Add support for specifying pid namespace by container id 2016-05-05 16:50:26 -04:00
.travis.yml Disable TIP build. 2016-03-23 14:51:27 -04:00
CHANGELOG.md Release v0.3.2 2016-03-30 13:08:29 -04: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 more maintainers to this repository 2016-04-21 17:07:00 +02:00
Makefile Fixes lint in `validate` target 2016-04-01 23:44:30 +02:00
README.md fix the incorrect demo code, the context argument should be passed in 2016-03-20 22:55:03 +08:00
appveyor.yml Add AppVeyor manifest to test on Windows boxes. 2016-03-02 13:20:56 -05:00
doc.go fix the incorrect demo code, the context argument should be passed in 2016-03-20 22:55:03 +08: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"
	"golang.org/x/net/context"
)

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(context.Background(), 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.

Developing

engine-api requires some minimal libraries that you can download running make deps.

To run tests, use the command make test. We use build tags to isolate functions and structures that are only available for testing.

To validate the sources, use the command make validate.

License

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