boatyard

command module
v0.0.0-...-f587f4f Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2015 License: Apache-2.0 Imports: 19 Imported by: 0

README

A Go web service which provides a HTTP API and a web UI for building, pushing, and deleting docker images.

Deprecation notice

This repository has been deprecated in favour of Tutum's new Automated Build functionality which uses the open source tutum/builder image for repository building.

Running

With docker and fig installed, and with docker listening in tcp://localhost:4243, simply run:

fig up -d

Run docker ps and check the allocated port for boatyard. Then point your browser to http://localhost:49XXX/ to open the web UI.

Configuration options

You can specify any of the following environment variables in the fig.yml to configure it:

  • DOCKER_HOST (default: tcp://localhost:4243): the endpoint where a Docker server is listening to
  • CACHE_1_PORT_6379_TCP_ADDR (default: none): the hostname to connect to a Redis cache
  • CACHE_1_PORT_6379_TCP_PORT (default: 6379): the port to connect to a Redis cache
  • CACHE_PASSWORD (default: none): an optional password to authenticate with the Redis cache

Usage

The primary inputs to create an image are:

  • Image name (i.e. user/myimage)
  • Username (to be used when pushing, i.e. user)
  • Password (to be used when pushing, i.e. password)
  • Email (to be used when pushing, i.e. user@example.com)

Any of the following inputs can be passed to boatyard to create the image:

  • A Dockerfile
  • A URL to a tarball containing a Dockerfile on the root folder and any required files
  • A GitHub repository (combination of GitHub username, repo name and tag)
  • A tarball sent as part of the request

API specification

Building

Requests

From Dockerfile:

POST /api/v1/build

{
	"image_name": "user/image",
	"username": "user",
	"password": "password",
	"email": "user@example.com",
	"dockerfile": "FROM ubuntu:saucy\nCMD echo \"Hello world\""
}

From a tarball URL:

POST /api/v1/build

{
	"image_name": "user/image",
	"username": "user",
	"password": "password",
	"email": "user@example.com",
	"tar_url": "https://github.com/tutumcloud/docker-hello-world/archive/v1.0.tar.gz"
}

From GitHub repository:

POST /api/v1/build

{
	"image_name": "user/image",
	"username": "user",
	"password": "password",
	"email": "user@example.com",
	"github_username": "tutumcloud",
	"github_reponame": "docker-hello-world",
	"github_tag": "v1.0"
}

From a tarball sent with the request:

POST /api/v1/build

----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="TarFile"; filename="dockertarexample.tar.gz"
Content-Type: application/x-gzip


----WebKitFormBoundaryE19zNvXGzXaLvS5C
Content-Disposition: form-data; name="Json"; filename="manifest.json"
Content-Type: application/json


----WebKitFormBoundaryE19zNvXGzXaLvS5C	

Where manifest.json has the following format.

{
	"image_name": "user/image",
	"username": "user",
	"password": "password",
	"email": "user@example.com"
}

### Response

{
	"JobIdentifier": "ef0c7a10-31a5-4140-6087-df97c2bebcb2"
}

The JobIdentifier can be used to check the status and logs with the following GET requests.

Checking job status

### Request

Issue the following request:

GET /api/v1/:jobid/status

where :jobid is the job ID returned in the build request (i.e. ef0c7a10-31a5-4140-6087-df97c2bebcb2)

Response
{
	"Status": "Pushing"
}

The status will show errors, and on a successful call the job status has three stages: "Building", "Pushing", and "Finished".

Checking job logs

### Request

Issue the following request:

GET /api/v1/:jobid/logs

where :jobid is the job ID returned in the build request (i.e. ef0c7a10-31a5-4140-6087-df97c2bebcb2)

Response
{
	"Logs": "Logs are returned as one string."
}

The logs catch the build logs and any errors returned from the docker host.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/ant0ine/go-json-rest/rest
A quick and easy way to setup a RESTful JSON API http://ant0ine.github.io/go-json-rest/ Go-Json-Rest is a thin layer on top of net/http that helps building RESTful JSON APIs easily.
A quick and easy way to setup a RESTful JSON API http://ant0ine.github.io/go-json-rest/ Go-Json-Rest is a thin layer on top of net/http that helps building RESTful JSON APIs easily.
_workspace/src/github.com/ant0ine/go-json-rest/rest/test
Utility functions to help writing tests for a Go-Json-Rest app Go comes with net/http/httptest to help writing test for an http server.
Utility functions to help writing tests for a Go-Json-Rest app Go comes with net/http/httptest to help writing test for an http server.
_workspace/src/github.com/ant0ine/go-json-rest/rest/trie
Special Trie implementation for HTTP routing.
Special Trie implementation for HTTP routing.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/nu7hatch/gouuid
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.
This package provides immutable UUID structs and the functions NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 and 5 UUIDs as specified in RFC 4122.

Jump to

Keyboard shortcuts

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