All Projects → danielsuo → libdocker

danielsuo / libdocker

Licence: MIT license
An SDK for the Docker Engine API in C

Programming Languages

c
50402 projects - #5 most used programming language
CMake
9771 projects
shell
77523 projects

Projects that are alternatives of or similar to libdocker

ansible-role-docker
Ansible Role for deploying docker-engine to hosts
Stars: ✭ 61 (+32.61%)
Mutual labels:  docker-engine
docker-client
A Docker client for Java written in Kotlin and Groovy
Stars: ✭ 100 (+117.39%)
Mutual labels:  docker-engine
trackit2-home
TrackIt helps you to optimize your AWS cloud
Stars: ✭ 46 (+0%)
Mutual labels:  docker-engine
Dry
dry - A Docker manager for the terminal @
Stars: ✭ 2,432 (+5186.96%)
Mutual labels:  docker-engine
docker-compose-file-format
Translation of docker-compose file format, 编排语法译文 v3.8
Stars: ✭ 23 (-50%)
Mutual labels:  docker-engine
docker-windows-azure
Deploy a Windows "Docker-Machine" on Azure
Stars: ✭ 19 (-58.7%)
Mutual labels:  docker-engine
docker-awesome
User Guide for Docker engine, compose. Example. doc, script, demo, example, etc. | support Mac, Ubuntu v16, v18, v20
Stars: ✭ 29 (-36.96%)
Mutual labels:  docker-engine
openblockchain
{START HERE} docker engine to roll your own openblockchain
Stars: ✭ 16 (-65.22%)
Mutual labels:  docker-engine

libdocker: an SDK for the Docker Engine API in C

A minimalist SDK for accessing the Docker Engine API via C.

Getting started

libdocker depends on curl, which can be installed easily via most package managers or from source. A typical workflow:

  • docker_init initializes a UNIX socket connection to the Docker Engine
  • docker_post and docker_get send requests to the Docker Engine REST API
  • docker_buffer gets response data
  • docker_destroy destroys docker object and frees any associated memory

Building the Code

  • Run the compile script to build the code. By default the example will be part of the build process. ( If anybody wants to not build the example, they can manually edit the base CMakeLists. In future, the compile script will accomodate the option.)
  • If the build is successful, then a deb package will be created in the build directory. Use the command sudo dpkg -i <deb package name> to install the package.
  • This will add libdocker.so to the /usr/lib directory and the example executable docker_example in /usr/bin
  • Also this will add the docker.h header file to /usr/include. If anybody wants to just use the library for dev purpose, they can include it directly.
  • Use the sudo command to run the executable created.
  • To remove the package ( i.e. the .so file, the docker.h header and the example executable in future ), use the command sudo dpkg -r docker_c_sdk

The library is pretty low-level for now (i.e., doesn't support parsing JSON responses or have any functions higher-level than post or get). An example application:

Multi-threaded applications

Should be fine, but be sure to have a look at curl's page on the subject (link here).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].