openshift/image-build-daemon

Name: image-build-daemon

Owner: OpenShift

Description: A Kubernetes-aware Docker build API extensions

Created: 2018-02-26 04:48:08.0

Updated: 2018-05-15 14:55:57.0

Pushed: 2018-02-26 05:48:47.0

Homepage:

Size: 8449

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

image-build-daemon

This project is in early alpha and may change significantly in the future.

The image-build-daemon acts as a Kubernetes-aware Docker build endpoint that limits what operations clients can perform to a safe subset and ensures the resources those clients consume are charged back to their pod. It automatically injects a Docker-API compatible unix domain socket into any pod that mounts a read-write emptydir to /var/run/docker/, and then accepts the following Docker API calls:

The daemon performs cleanup, quota, and scoping to the calling pod, ensuring that resources consumed by a build pod are fairly used. The normal Docker CLI or API client can create operations, although not all parameters are supported.

The daemon also supports multiple backends with the future goal of removing the need for a Docker daemon on the host, specified with --mode:

Trying it out

Clone the source into your GOPATH and build with:

make

To test locally without a running Kubernetes server, start your Docker daemon and then run:

./image-build-daemon -v=5 --bind-local=/tmp &

To start the daemon running in the background. Then launch a fake Kubernetes container with

make fake

The container named daemon-test will be started, and image-build-daemon will create /tmp/docker.sock (due to --bind-local being passed).

To test against the daemon, run

export DOCKER_HOST=unix:///tmp/docker.sock 
docker build vendor/github.com/openshift/imagebuilder/dockerclient/testdata/volume/

And you should see a build created.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.