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
Size: 24
Language: Clojure
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
An incomplete Docker remote API client written in Clojure. Supports TLS and API version 1.18
.
To install, add the following dependency to your project.clj file:
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))
This project uses core.test, so to run tests:
lein test
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.
Copyright © 2015 Will Farrell
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.