libcompose

package module
v0.0.0-...-cb0fbf9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2015 License: Apache-2.0 Imports: 0 Imported by: 0

README

libcompose

GoDoc Jenkins Build Status

A Go library for Docker Compose. It does everything the command-line tool does, but from within Go -- read Compose files, start them, scale them, etc.

Note: This is experimental and not intended to replace the Docker Compose command-line tool. If you're looking to use Compose, head over to the Compose installation instructions to get started with it.

package main

import (
	"log"

	"github.com/docker/libcompose/docker"
	"github.com/docker/libcompose/project"
)

func main() {
	project, err := docker.NewProject(&docker.Context{
		Context: project.Context{
			ComposeFile: "docker-compose.yml",
			ProjectName: "my-compose",
		},
	})

	if err != nil {
		log.Fatal(err)
	}

	project.Up()
}

Building

You need Docker and make and then run the binary target. This will create binary for all platform in the bundles folder.

$ make binary
docker build -t "libcompose-dev:refactor-makefile" .
# […]
---> Making bundle: binary (in .)
Number of parallel builds: 4

-->      darwin/386: github.com/docker/libcompose/cli/main
-->    darwin/amd64: github.com/docker/libcompose/cli/main
-->       linux/386: github.com/docker/libcompose/cli/main
-->     linux/amd64: github.com/docker/libcompose/cli/main
-->       linux/arm: github.com/docker/libcompose/cli/main
-->     windows/386: github.com/docker/libcompose/cli/main
-->   windows/amd64: github.com/docker/libcompose/cli/main

$ ls bundles
libcompose-cli_darwin-386*    libcompose-cli_linux-amd64*      libcompose-cli_windows-amd64.exe*
libcompose-cli_darwin-amd64*  libcompose-cli_linux-arm*
libcompose-cli_linux-386*     libcompose-cli_windows-386.exe*

Running

A partial implementation of the libcompose-cli CLI is also implemented in Go. The primary purpose of this code is so one can easily test the behavior of libcompose.

Run one of these:

libcompose-cli_darwin-386
libcompose-cli_linux-amd64
libcompose-cli_windows-amd64.exe
libcompose-cli_darwin-amd64
libcompose-cli_linux-arm
libcompose-cli_linux-386
libcompose-cli_windows-386.exe
Tests

You can run unit tests using the test-unit target and the integration test using the test-integration target.

$ make test-unit
docker build -t "libcompose-dev:refactor-makefile" .
#[…]
---> Making bundle: test-unit (in .)
+ go test -cover -coverprofile=cover.out ./docker
ok      github.com/docker/libcompose/docker     0.019s  coverage: 4.6% of statements
+ go test -cover -coverprofile=cover.out ./project
ok      github.com/docker/libcompose/project    0.010s  coverage: 8.4% of statements
+ go test -cover -coverprofile=cover.out ./version
ok      github.com/docker/libcompose/version    0.002s  coverage: 0.0% of statements

Test success

Current status

The project is still being kickstarted... But it does a lot. Please try it out and help us find bugs.

Contributing

Want to hack on libcompose? Docker's contributions guidelines apply.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/docker/distribution
Package distribution will define the interfaces for the components of docker distribution.
Package distribution will define the interfaces for the components of docker distribution.
_workspace/src/github.com/docker/distribution/cmd/registry-api-descriptor-template
registry-api-descriptor-template uses the APIDescriptor defined in the api/v2 package to execute templates passed to the command line.
registry-api-descriptor-template uses the APIDescriptor defined in the api/v2 package to execute templates passed to the command line.
_workspace/src/github.com/docker/distribution/context
Package context provides several utilities for working with golang.org/x/net/context in http requests.
Package context provides several utilities for working with golang.org/x/net/context in http requests.
_workspace/src/github.com/docker/distribution/digest
Package digest provides a generalized type to opaquely represent message digests and their operations within the registry.
Package digest provides a generalized type to opaquely represent message digests and their operations within the registry.
_workspace/src/github.com/docker/distribution/health
Package health provides a generic health checking framework.
Package health provides a generic health checking framework.
_workspace/src/github.com/docker/distribution/registry
Package registry is a placeholder package for registry interface definitions and utilities.
Package registry is a placeholder package for registry interface definitions and utilities.
_workspace/src/github.com/docker/distribution/registry/api/v2
Package v2 describes routes, urls and the error codes used in the Docker Registry JSON HTTP API V2.
Package v2 describes routes, urls and the error codes used in the Docker Registry JSON HTTP API V2.
_workspace/src/github.com/docker/distribution/registry/auth
Package auth defines a standard interface for request access controllers.
Package auth defines a standard interface for request access controllers.
_workspace/src/github.com/docker/distribution/registry/auth/htpasswd
Package htpasswd provides a simple authentication scheme that checks for the user credential hash in an htpasswd formatted file in a configuration-determined location.
Package htpasswd provides a simple authentication scheme that checks for the user credential hash in an htpasswd formatted file in a configuration-determined location.
_workspace/src/github.com/docker/distribution/registry/auth/silly
Package silly provides a simple authentication scheme that checks for the existence of an Authorization header and issues access if is present and non-empty.
Package silly provides a simple authentication scheme that checks for the existence of an Authorization header and issues access if is present and non-empty.
_workspace/src/github.com/docker/distribution/registry/storage
Package storage contains storage services for use in the registry application.
Package storage contains storage services for use in the registry application.
_workspace/src/github.com/docker/distribution/registry/storage/cache
Package cache provides facilities to speed up access to the storage backend.
Package cache provides facilities to speed up access to the storage backend.
_workspace/src/github.com/docker/distribution/registry/storage/driver/azure
Package azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
Package azure provides a storagedriver.StorageDriver implementation to store blobs in Microsoft Azure Blob Storage Service.
_workspace/src/github.com/docker/distribution/registry/storage/driver/base
Package base provides a base implementation of the storage driver that can be used to implement common checks.
Package base provides a base implementation of the storage driver that can be used to implement common checks.
_workspace/src/github.com/docker/distribution/registry/storage/driver/middleware/cloudfront
Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
Package middleware - cloudfront wrapper for storage libs N.B. currently only works with S3, not arbitrary sites
_workspace/src/github.com/docker/distribution/registry/storage/driver/rados
Package rados implements the rados storage driver backend.
Package rados implements the rados storage driver backend.
_workspace/src/github.com/docker/distribution/registry/storage/driver/s3
Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
Package s3 provides a storagedriver.StorageDriver implementation to store blobs in Amazon S3 cloud storage.
_workspace/src/github.com/docker/distribution/registry/storage/driver/swift
Package swift provides a storagedriver.StorageDriver implementation to store blobs in Openstack Swift object storage.
Package swift provides a storagedriver.StorageDriver implementation to store blobs in Openstack Swift object storage.
_workspace/src/github.com/docker/distribution/uuid
Package uuid provides simple UUID generation.
Package uuid provides simple UUID generation.
_workspace/src/github.com/docker/docker/api/client
Package client provides a command-line interface for Docker.
Package client provides a command-line interface for Docker.
_workspace/src/github.com/docker/docker/api/types
This package is used for API stability in the types and response to the consumers of the API stats endpoint.
This package is used for API stability in the types and response to the consumers of the API stats endpoint.
_workspace/src/github.com/docker/docker/autogen/dockerversion
AUTOGENERATED FILE; see ./hack/make/.go-autogen
AUTOGENERATED FILE; see ./hack/make/.go-autogen
_workspace/src/github.com/docker/docker/pkg/parsers
Package parsers provides helper functions to parse and validate different type of string.
Package parsers provides helper functions to parse and validate different type of string.
_workspace/src/github.com/docker/docker/pkg/parsers/filters
Package filters provides helper function to parse and handle command line filter, used for example in docker ps or docker images commands.
Package filters provides helper function to parse and handle command line filter, used for example in docker ps or docker images commands.
_workspace/src/github.com/docker/docker/pkg/parsers/kernel
Package kernel provides helper function to get, parse and compare kernel versions for different platforms.
Package kernel provides helper function to get, parse and compare kernel versions for different platforms.
_workspace/src/github.com/docker/docker/pkg/parsers/operatingsystem
Package operatingsystem provides helper function to get the operating system name for different platforms.
Package operatingsystem provides helper function to get the operating system name for different platforms.
_workspace/src/github.com/docker/docker/pkg/pools
Package pools provides a collection of pools which provide various data types with buffers.
Package pools provides a collection of pools which provide various data types with buffers.
_workspace/src/github.com/docker/docker/pkg/stringid
Package stringid provides helper functions for dealing with string identifiers
Package stringid provides helper functions for dealing with string identifiers
_workspace/src/github.com/docker/docker/pkg/tarsum
Package tarsum provides algorithms to perform checksum calculation on filesystem layers.
Package tarsum provides algorithms to perform checksum calculation on filesystem layers.
_workspace/src/github.com/docker/docker/pkg/term
Package term provides provides structures and helper functions to work with terminal (state, sizes).
Package term provides provides structures and helper functions to work with terminal (state, sizes).
_workspace/src/github.com/docker/docker/pkg/timeutils
Package timeutils provides helper functions to parse and print time (time.Time).
Package timeutils provides helper functions to parse and print time (time.Time).
_workspace/src/github.com/docker/docker/pkg/tlsconfig
Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.
Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.
_workspace/src/github.com/docker/docker/pkg/ulimit
Package ulimit provides structure and helper function to parse and represent resource limits (Rlimit and Ulimit, its human friendly version).
Package ulimit provides structure and helper function to parse and represent resource limits (Rlimit and Ulimit, its human friendly version).
_workspace/src/github.com/docker/docker/pkg/units
Package units provides helper function to parse and print size and time units in human-readable format.
Package units provides helper function to parse and print size and time units in human-readable format.
_workspace/src/github.com/docker/docker/pkg/urlutil
Package urlutil provides helper function to check urls kind.
Package urlutil provides helper function to check urls kind.
_workspace/src/github.com/docker/docker/pkg/useragent
Package useragent provides helper functions to pack version information into a single User-Agent header.
Package useragent provides helper functions to pack version information into a single User-Agent header.
_workspace/src/github.com/docker/docker/volume/local
Package local provides the default implementation for volumes.
Package local provides the default implementation for volumes.
_workspace/src/github.com/docker/libtrust
Package libtrust provides an interface for managing authentication and authorization using public key cryptography.
Package libtrust provides an interface for managing authentication and authorization using public key cryptography.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
_workspace/src/golang.org/x/crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
_workspace/src/golang.org/x/net/context
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes.
_workspace/src/gopkg.in/check.v1
Package check is a rich testing extension for Go's testing package.
Package check is a rich testing extension for Go's testing package.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
cli
app

Jump to

Keyboard shortcuts

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