From bb84a17805cbdb48ca9c374a83c1114765912bc9 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Tue, 26 Jan 2016 11:35:05 -0800 Subject: [PATCH] Add 'make docker' target. The 'make docker' target will verify that docker is installed and run the builder in update and isolation mode. --- .bashrc | 16 ++++++++++++++++ .gitignore | 3 +-- Makefile | 21 +++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .bashrc diff --git a/.bashrc b/.bashrc new file mode 100644 index 00000000..8526d6d1 --- /dev/null +++ b/.bashrc @@ -0,0 +1,16 @@ +############################################################ +# +# When running the ONL builder in isolation mode +# $HOME is set to the root of the ONL tree from +# which you entered the builder. +# +# The assumption here is that you are trying to build +# the tree from which you entered the builder, and +# thus we automatically source the setup.env file +# upon starting the shell inside the container. +# +############################################################ + +. setup.env + +echo Ready to build OpenNetworkLinux. diff --git a/.gitignore b/.gitignore index 602f954c..b0b952ef 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,4 @@ dependmodules.x .manifest.mk RELEASE/ - - +.bash_history diff --git a/Makefile b/Makefile index fc9c3f32..dddfc09b 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,12 @@ # Rudimentary work in progress. # ############################################################ +ifneq ($(MAKECMDGOALS),docker) + +ifndef ONL +$(error Please source the setup.env script at the root of the ONL tree) +endif + include $(ONL)/make/config.mk all: amd64 ppc @@ -22,3 +28,18 @@ onl-ppc ppc: rpc rebuild: $(ONLPM) --rebuild-pkg-cache + +endif + + +.PHONY: docker + +ifndef VERSION +VERSION:=7 +endif + +docker_check: + @which docker > /dev/null || (echo "*** Docker appears to be missing. Please install docker.io in order to build OpenNetworkLinux." && exit 1) + +docker: docker_check + @docker/tools/onlbuilder -$(VERSION) --isolate --hostname onlbuilder$(VERSION) --pull