mrunalp / go-dockerclient

Go HTTP client for the Docker remote API.

Home Page:http://godoc.org/github.com/fsouza/go-dockerclient

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#go-dockerclient

Build Status Build Status

GoDoc

This package presents a client for the Docker remote API.

For more details, check the remote API documentation.

Example

package main

import (
        "fmt"
        "github.com/fsouza/go-dockerclient"
)

func main() {
        endpoint := "unix:///var/run/docker.sock"
        client, _ := docker.NewClient(endpoint)
        imgs, _ := client.ListImages(docker.ListImagesOptions{All: false})
        for _, img := range imgs {
                fmt.Println("ID: ", img.ID)
                fmt.Println("RepoTags: ", img.RepoTags)
                fmt.Println("Created: ", img.Created)
                fmt.Println("Size: ", img.Size)
                fmt.Println("VirtualSize: ", img.VirtualSize)
                fmt.Println("ParentId: ", img.ParentID)
        }
}

Developing

You can run the tests with:

go get -d ./...
go test ./...

About

Go HTTP client for the Docker remote API.

http://godoc.org/github.com/fsouza/go-dockerclient

License:Other


Languages

Language:Go 99.8%Language:Shell 0.2%