twosigma/docker-client-clj

Name: docker-client-clj

Owner: Two Sigma

Description: A Docker client written in Clojure. Supports TLS/HTTPS.

Created: 2016-06-13 16:13:02.0

Updated: 2016-10-11 14:58:11.0

Pushed: 2016-06-13 17:24:42.0

Homepage:

Size: 24

Language: Clojure

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

docker-client

Build Status

An incomplete Docker remote API client written in Clojure. Supports TLS and API version 1.18.

Installation

To install, add the following dependency to your project.clj file:

Clojars Project

Usage

To get started, require the core namespace:

uire '[docker-client.core :as docker])

Next, create a docker client. By default, configuration is pulled from the DOCKER_HOST, DOCKER_CERT_PATH and DOCKER_VERIFY_TLS environment variables. If DOCKER_VERIFY_TLS and DOCKER_CERT_PATH are both set, read credentials from disk and use https. This behavior can be overridden by passing configuration to the docker/client function:

reates a client with default configuration from the environment
 c
ocker/client))

onfiguration can also be overridden
 c
ocker/client {:uri "http://localhost:4343"}))

Once you have a client, you pass it to any of the implemented public functions. So far, that includes:

reate a container
 [{id :id} (create-container!
             c
             {:cmd ["sleep" "100"]
              :env ["A_VAR=a_value"]
              :image "debian:wheezy"})]

 inspect its configuration
nspect-container c id)

 start the container
tart-container! c id)

 stop the container
top-container! c id)

 remove the container
emove-container! c id))
Tests

This project uses core.test, so to run tests:

lein test

Future

This client is a work in progress; there are many endpoints left to implement. If you have a pressing need for a particular feature, create an issue.

License

Copyright © 2015 Will Farrell

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.