From 2de8687de485717a6a2b12bc186f03e4c9d7b5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Wed, 19 Dec 2018 16:29:02 +0000 Subject: initial docker build support --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 7e7099d..0784785 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ +KERNEL ?= $(shell uname -r) DESTDIR=/opt/ioriot all: - $(MAKE) -C systemtap $(MAKE) -C ioriot + $(MAKE) -C systemtap install: - $(MAKE) -C systemtap install $(MAKE) -C ioriot install + $(MAKE) -C systemtap install uninstall: test ! -z $(DESTDIR) && test -d $(DESTDIR) && rm -Rfv $(DESTDIR) || exit 0 deinstall: uninstall @@ -19,3 +20,7 @@ doxygen: doxygen ./docs/doxygen.conf test: $(MAKE) -C ioriot test +dockerbuild: + sed s/KERNELVERSION/$(KERNEL)/ Dockerfile.in > Dockerfile + docker build . -t ioriot:$(KERNEL) + docker run -it ioriot:$(KERNEL) --entrypoint /bin/bash -c 'make' -- cgit v1.2.3 From 081b6058bc89ae755f71f11f22423db27b1aeb3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Wed, 19 Dec 2018 17:17:22 +0000 Subject: can compile I/O Riot using Docker (tested on Mac OS X) --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0784785..ac19433 100644 --- a/Makefile +++ b/Makefile @@ -23,4 +23,5 @@ test: dockerbuild: sed s/KERNELVERSION/$(KERNEL)/ Dockerfile.in > Dockerfile docker build . -t ioriot:$(KERNEL) - docker run -it ioriot:$(KERNEL) --entrypoint /bin/bash -c 'make' + bash -c 'test ! -d /tmp/docker/opt/ && mkdir -p /tmp/docker/opt/; exit 0' + docker run -v /tmp/docker/opt:/opt -it ioriot:$(KERNEL) make all install -- cgit v1.2.3 From 31c31c1de8d4bb0b9be832bb34f998ce998dd8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Wed, 19 Dec 2018 20:33:16 +0000 Subject: can compile for various kernel versions using docker now --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ac19433..e3cc8e1 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ KERNEL ?= $(shell uname -r) DESTDIR=/opt/ioriot all: - $(MAKE) -C ioriot $(MAKE) -C systemtap + $(MAKE) -C ioriot install: - $(MAKE) -C ioriot install $(MAKE) -C systemtap install + $(MAKE) -C ioriot install uninstall: test ! -z $(DESTDIR) && test -d $(DESTDIR) && rm -Rfv $(DESTDIR) || exit 0 deinstall: uninstall @@ -21,7 +21,7 @@ doxygen: test: $(MAKE) -C ioriot test dockerbuild: - sed s/KERNELVERSION/$(KERNEL)/ Dockerfile.in > Dockerfile + sed s/KERNEL/$(KERNEL)/ Dockerfile.in > Dockerfile docker build . -t ioriot:$(KERNEL) bash -c 'test ! -d /tmp/docker/opt/ && mkdir -p /tmp/docker/opt/; exit 0' - docker run -v /tmp/docker/opt:/opt -it ioriot:$(KERNEL) make all install + docker run -v /tmp/docker/opt:/opt -v /tmp/docker/downloads:/ioriot/systemtap/downloads -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all install -- cgit v1.2.3 From f30db3239fdb0c134b76ef75e780bf014b4a0342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Thu, 27 Dec 2018 07:01:54 +0000 Subject: move docker build volume to ./docker --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e3cc8e1..badf2b5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ KERNEL ?= $(shell uname -r) DESTDIR=/opt/ioriot +PWD=$(shell pwd) all: $(MAKE) -C systemtap $(MAKE) -C ioriot @@ -23,5 +24,5 @@ test: dockerbuild: sed s/KERNEL/$(KERNEL)/ Dockerfile.in > Dockerfile docker build . -t ioriot:$(KERNEL) - bash -c 'test ! -d /tmp/docker/opt/ && mkdir -p /tmp/docker/opt/; exit 0' - docker run -v /tmp/docker/opt:/opt -v /tmp/docker/downloads:/ioriot/systemtap/downloads -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all install + bash -c 'test ! -d $(PWD)/docker/opt/ && mkdir -p $(PWD)/docker/opt/; exit 0' + docker run -v $(PWD)/docker/opt:/opt -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all install -- cgit v1.2.3 From 278cab7adf284a7bca43d2d747b8aff698e0ca27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= Date: Thu, 27 Dec 2018 07:54:17 +0000 Subject: run unit tests when built w/ docker --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index badf2b5..02ce80a 100644 --- a/Makefile +++ b/Makefile @@ -25,4 +25,6 @@ dockerbuild: sed s/KERNEL/$(KERNEL)/ Dockerfile.in > Dockerfile docker build . -t ioriot:$(KERNEL) bash -c 'test ! -d $(PWD)/docker/opt/ && mkdir -p $(PWD)/docker/opt/; exit 0' - docker run -v $(PWD)/docker/opt:/opt -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all install + docker run -v $(PWD)/docker/opt:/opt -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all test install +dockerclean: + bash -c 'test -d $(PWD)/docker && rm -Rfv $(PWD)/docker; exit 0' -- cgit v1.2.3 From 1eb58df1ac797db9545fb2cb3b3047cc794109f9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 27 Dec 2018 08:36:00 +0000 Subject: can run dockerbuild on Fedora 28 with selinux in enforcing mode --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 02ce80a..fb75703 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,12 @@ doxygen: test: $(MAKE) -C ioriot test dockerbuild: + bash -c 'test ! -d $(PWD)/docker/opt/ && mkdir -p $(PWD)/docker/opt/; exit 0' + bash -c 'test -f /etc/fedora-release && sudo chcon -Rt svirt_sandbox_file_t $(PWD)/docker/opt; exit 0' + bash -c 'test -f /etc/centos-release && sudo chcon -Rt svirt_sandbox_file_t $(PWD)/docker/opt; exit 0' + bash -c 'test -f /etc/redhat-release && sudo chcon -Rt svirt_sandbox_file_t $(PWD)/docker/opt; exit 0' sed s/KERNEL/$(KERNEL)/ Dockerfile.in > Dockerfile docker build . -t ioriot:$(KERNEL) - bash -c 'test ! -d $(PWD)/docker/opt/ && mkdir -p $(PWD)/docker/opt/; exit 0' docker run -v $(PWD)/docker/opt:/opt -e 'KERNEL=$(KERNEL)' -it ioriot:$(KERNEL) make all test install dockerclean: bash -c 'test -d $(PWD)/docker && rm -Rfv $(PWD)/docker; exit 0' -- cgit v1.2.3