Skip to content
Crystal wrapper for the Docker API
Crystal
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
spec
src
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
shard.yml

README.md

docker-api

Complete docker api wrapper for Crystal. Based off of the docker-api Ruby Gem.

This is very much alpha software and should be treated as such.

Installation

Add this to your application's shard.yml:

dependencies:
  docker-api:
    github: watzon/docker-api

Usage

require "docker-api"

# List versions
version = Docker.version
p version # => #<Docker::Types::Version:0x564e6108fcb0 ...

# Get all containers
containers = Docker::Container.all
first_one = containers.first

# Get info about the container
p first_one.info # => { "Names" => [...], "Image" => "...", ... }

# Remove the container
first_one.remove

# Spin up a new container
container = Docker::Container.create("some-redis", { image: "redis" })
p container.info # => { "Names" => ["some-redis"], "Image" => "redis", ... }

Development

Current features

  • API Connector
  • Containers
  • Events
  • Images
  • Messages
  • Networks
  • Volumes
  • Services
  • Nodes
  • Swarm
  • Tasks
  • Plugins

Hangups

  • The docker /archive method requires tar packing/unpacking.

Contributing

  1. Fork it ( https://github.com/watzon/docker-api/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

  • watzon Chris Watson - creator, maintainer
You can’t perform that action at this time.