From a302932c8ff2f44f14fa87ff882b8bcaa30dcd66 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Thu, 16 Oct 2014 17:14:19 +0100 Subject: [PATCH 1/3] Use official python repository in Dockerfile Signed-off-by: Ben Firshman --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7761db74..2e6f47f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ -FROM ubuntu:12.10 +FROM python:2.7 MAINTAINER Joffrey F -RUN apt-get update -RUN yes | apt-get install python-pip ADD . /home/docker-py -RUN cd /home/docker-py && pip install . +WORKDIR /home/docker-py +RUN pip install . From 695a894a5390f457ac009e87abaa302959c0a338 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Thu, 16 Oct 2014 17:14:35 +0100 Subject: [PATCH 2/3] Install test requirements in Dockerfile Handy for running tests and so on. Signed-off-by: Ben Firshman --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 2e6f47f9..733f96cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,4 +2,5 @@ FROM python:2.7 MAINTAINER Joffrey F ADD . /home/docker-py WORKDIR /home/docker-py +RUN pip install -r test-requirements.txt RUN pip install . From 4d0416ac91e06d5401047fdf0dccf00d3b43dd95 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Thu, 16 Oct 2014 17:53:41 +0100 Subject: [PATCH 3/3] Add Makefile for running tests in Docker It assumes you've got Docker running on /var/run/docker.sock, but that should be the case on both Linux and in Boot2Docker. Signed-off-by: Ben Firshman --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..4cb0ffda --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +.PHONY: all build test integration-test unit-test + +all: test + +build: + docker build -t docker-py . + +test: unit-test integration-test + +unit-test: build + docker run docker-py python tests/test.py + +integration-test: build + docker run -v /var/run/docker.sock:/var/run/docker.sock docker-py python tests/integration_test.py +