From ec9d8769f0bc2b2db07d64484695f379953d8774 Mon Sep 17 00:00:00 2001 From: Ben Hall Date: Fri, 18 Dec 2015 12:18:41 +0100 Subject: [PATCH] Add a Dockerfile and a dbuild target. This allows you to build runC via Docker without having Golang installed on the host Signed-off-by: Ben Hall --- Dockerfile | 3 +++ Makefile | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..a25c22107 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM runc_test +ADD . /go/src/github.com/opencontainers/runc +RUN make diff --git a/Makefile b/Makefile index a70897220..24dfcc8a6 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ +RUNC_IMAGE=runc_dev RUNC_TEST_IMAGE=runc_test PROJECT=github.com/opencontainers/runc TEST_DOCKERFILE=script/test_Dockerfile BUILDTAGS=seccomp +RUNC_BUILD_PATH=/go/src/github.com/opencontainers/runc/runc +RUNC_INSTANCE=runc_dev export GOPATH:=$(CURDIR)/Godeps/_workspace:$(GOPATH) +.PHONY=dbuild + all: go build -tags "$(BUILDTAGS)" -o runc . @@ -26,6 +31,11 @@ test: runctestimage localtest: go test -tags "$(BUILDTAGS)" ${TESTFLAGS} -v ./... +dbuild: runctestimage + docker build -t $(RUNC_IMAGE) . + docker create --name=$(RUNC_INSTANCE) $(RUNC_IMAGE) + docker cp $(RUNC_INSTANCE):$(RUNC_BUILD_PATH) . + docker rm $(RUNC_INSTANCE) install: cp runc /usr/local/bin/runc