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 <ben@benhall.me.uk>
This commit is contained in:
Ben Hall 2015-12-18 12:18:41 +01:00
parent 9d6ce7168a
commit ec9d8769f0
2 changed files with 13 additions and 0 deletions

3
Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM runc_test
ADD . /go/src/github.com/opencontainers/runc
RUN make

View File

@ -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