Liking cljdoc? Tell your friends :D

clj-docker-client

License: GPL v3 Clojars Project Build Status

[lispyclouds/clj-docker-client "0.1.4"]

An idiomatic Clojure Docker client based on the excellent JVM client by Spotify.

This is a work in progress and aims to be fully compliant and up to date with the Docker API changes.

Usage

(require '[clj-docker-client.core :as docker])

Creating a connection to the Local Docker daemon

(def conn (docker/connect))

Ping the Docker server

(docker/ping conn)

Image Handling

Pulling the busybox:musl image

(docker/pull conn "busybox:musl")

Building an image from a Dockerfile

(docker/build conn "full path to directory containing a Dockerfile")

Pushing an image

(docker/push conn "image id or <repo>:<tag>")

Removing an image

(docker/image-rm conn "image id or <repo>:<tag>")

List all available images

(docker/image-ls conn)

Container Handling

Creating a container with the busybox:musl image, a command and a env var

(docker/create conn "busybox:musl" "echo hello" {:env "testing"})

Listing all available containers

(docker/ps conn) ; Only running containers
(docker/ps conn true) ; All containers

Starting a container

(docker/start conn "name or id")

Stopping a container

(docker/stop conn "name or id")

Killing a container

(docker/kill conn "name or id")

Removing a container

(docker/rm conn "id or name") ; Remove non-running container
(docker/rm conn "id or name" true) ; Force remove non-running container

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close