From 122e8d8c6e31f5e97ea10322438b8aaca42c4e09 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Sat, 8 Aug 2015 18:11:22 -0400 Subject: [PATCH 1/2] Add a container to run docker-custodian and install instructions to the README. --- .dockerignore | 4 ++++ Dockerfile | 10 ++++++++++ Makefile | 10 +++++++++- README.rst | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..8527cdd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.tox +tox.ini +dist diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5305d36 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ + +FROM alpine:3.2 +MAINTAINER Daniel Nephin + +RUN apk add -U python py-pip +ADD requirements.txt /code/requirements.txt +RUN pip install -r /code/requirements.txt +ADD docker_custodian/ /code/docker_custodian/ +ADD setup.py /code/ +RUN pip install --no-deps -e /code diff --git a/Makefile b/Makefile index a51bf47..210d541 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ .PHONY: all clean tag test -PACKAGE_VERSION=$(shell python setup.py --version) +PACKAGE_VERSION = $(shell python setup.py --version) + +DOCKER_REPO ?= ${USER} +BUILD_TAG ?= ${PACKAGE_VERSION} all: test @@ -16,3 +19,8 @@ test: tox tests: test + + +.PHONY: build +build: + docker build -t ${DOCKER_REPO}/docker-custodian:${BUILD_TAG} . diff --git a/README.rst b/README.rst index 5743e27..6d90ac9 100644 --- a/README.rst +++ b/README.rst @@ -10,6 +10,41 @@ Keep docker hosts tidy. .. contents:: :backlinks: none +Install +------- + +There are three installation options + +Container +~~~~~~~~~ + +.. code:: + + docker pull dnephin/docker-custodian + docker run -ti dnephin/docker-custodian dcgc --help + +Debian/Ubuntu package +~~~~~~~~~~~~~~~~~~~~~ + +First build the package (requires `dh-virtualenv`) + +.. code:: sh + + dpkg-buildpackage -us -uc + +Then install it + +.. code:: sh + + dpkg -i ../docker-custodian_*.deb + + +Source +~~~~~~ + +.. code:: sh + + pip install git+https://github.com/Yelp/docker-custodian.git dcgc From 7a5336c47c8390f0480373d0e01f6b8b67742fe7 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 31 Aug 2015 21:31:14 -0400 Subject: [PATCH 2/2] Fix run instructions for the container. --- README.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6d90ac9..8d03a78 100644 --- a/README.rst +++ b/README.rst @@ -21,7 +21,9 @@ Container .. code:: docker pull dnephin/docker-custodian - docker run -ti dnephin/docker-custodian dcgc --help + docker run -ti \ + -v /var/run/docker.sock:/var/run/docker.sock \ + dnephin/docker-custodian dcgc --help Debian/Ubuntu package ~~~~~~~~~~~~~~~~~~~~~