• Stars
    star
    26
  • Rank 900,515 (Top 19 %)
  • Language
    Crystal
  • License
    MIT License
  • Created about 8 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker API client in Crystal.

Crystal Docker API client

Installation

Add this to your application's shard.yml:

dependencies:
  docker:
    github: jeromegn/docker.cr

Status: Developer Preview

This is not nearly complete. Just got the initial connecting working and simple casting. I added a few commands as a proof of concept.

This shard extends OpenSSL and HTTP::Client a little bit to support Docker's SSL method (TLS V1.)

Usage

require "docker"

Options

By default, options will be taken from the environment variables:

DOCKER_URL or DOCKER_HOST
DOCKER_VERIFY_TLS
DOCKER_CERT_PATH

but they can also be set manually like:

Docker.client.url = "tcp://192.168.99.100:2376"
Docker.client.verify_tls = true
Docker.client.cert_path = "#{ENV["HOME"]}/.docker"

If nothing is set, this client will use the unix socket.

Info

Docker.client.info.container # => Returns container count

Containers

Docker.client.containers # => Array of Docker::Container
container = Docker.client.containers.first
p container # => #<Docker::Container:0x10f6a3ea0 @id="cbbeb51f25b4c91b61e6d1b5fc0c1c2bb470ccd8aaf5dc4a57885f35f21d7245", @names=["api"], @image="ruby" ...>

container.stop
container.start
container.restart
container.kill

Contributing

  1. Fork it ( https://github.com/jeromegn/docker.cr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • jeromegn Jerome Gravel-Niquet - creator, maintainer

More Repositories

1

Backbone.localStorage

A localStorage adapter for Backbone.js
JavaScript
1,899
star
2

DocumentUp

Pretty documentation generator for Github projects with proper Readme.
Ruby
886
star
3

slang

Slim-inspired templating language for Crystal
Crystal
232
star
4

kilt

Generic template interface for Crystal
Crystal
148
star
5

localtodos

Simple Todos App built on Backbone.js
JavaScript
99
star
6

protobuf.cr

Protobuf generator, encoder and decoder.
Crystal
95
star
7

poutine

MongoDB ORM for Node.js
CoffeeScript
35
star
8

influxdb.cr

InfluxDB driver for Crystal
Crystal
25
star
9

bson.cr

BSON implementation written in Crystal
Crystal
24
star
10

v8.cr

V8 bindings for Crystal
C++
16
star
11

dry-types-rails

Dry::Types railties
Ruby
11
star
12

beautifier

A safari extension which smooths fonts!
10
star
13

Warping-Shadow-CSS3

Warping Shadows can be done in CSS3
Ruby
8
star
14

mongol

Light modeling for MongoDB.
JavaScript
8
star
15

jeromegn.github.com

Personal site
HTML
5
star
16

rapid

Redis ORM-ish api for nodejs
JavaScript
3
star
17

backbone.pjax

Backbone utilities for web apps using PJAX.
JavaScript
3
star
18

rhai-tpl

Simple template engine using rhai for logic
Rust
2
star
19

qml.cr

QML library for Crystal
Crystal
2
star
20

quinn-plaintext

QUIC pluggable crypto to use the protocol as plaintext (for use when cryptography is already handled at another layer, e.g. Wireguard)
Rust
1
star
21

Radiophonique

Objective-C
1
star
22

containerd-rs

Rust
1
star
23

lg-ultrafine-brightness

Control LG Ultrafine brightness on linux
Rust
1
star
24

documentup.js

experimental DocumentUp running on fly.io
JavaScript
1
star
25

portfolio

My portfolio, built with StaticMatic
JavaScript
1
star
26

node-api-boilerplate

Simple Node.js API server boilerplate using CoffeeScript and Express
CoffeeScript
1
star