From a0ffce6cd79417012e4cd85a7ddb194af9e047a5 Mon Sep 17 00:00:00 2001 From: yangshukui Date: Tue, 1 Mar 2016 15:18:30 +0800 Subject: [PATCH] add makefile for clair Signed-off-by: yangshukui --- Dockerfile.dev | 10 ++++++++++ Makefile | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile.dev create mode 100644 Makefile diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 00000000..7fe6a161 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,10 @@ +FROM golang:1.5 +MAINTAINER Quentin Machu +RUN apt-get update && \ + apt-get install -y bzr rpm xz-utils && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +WORKDIR /go/src/github.com/coreos/clair/ +ENV GO15VENDOREXPERIMENT 1 diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f5b41706 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +.PHONY: all binary build + +IMAGE := clair-dev +CLAIR_IMAGE := clair +DOCKERFILE := Dockerfile.dev +DOCKERFILE_CLAIR := Dockerfile +CLAIR_ENVS := +CLAIR_MOUNT := -v `pwd`:/go/src/github.com/coreos/clair/ +CLAIR_RUN_DOCKER := docker run --rm -i $(CLAIR_ENVS) $(CLAIR_MOUNT) $(IMAGE) + +all: build binary clair + +build: bundles + docker build -t "$(IMAGE)" -f "$(DOCKERFILE)" . +binary: build + $(CLAIR_RUN_DOCKER) go build -o bundles/clair ./cmd/clair +clair: + docker build -t "$(CLAIR_IMAGE)" -f "$(DOCKERFILE_CLAIR)" . +bundles: + mkdir bundles +clean: + rm -rf bundles