Add docker-build target for make
@@ -31,3 +31,17 @@ all:
$(MAKE) -f os/linux/Makefile core$@
$(MAKE) -f cli/Makefile cli$@
endif
+
+.PHONY: docker-build
+docker-build: TAG?="appscope-builder:$(VERSION)"
+docker-build: DOCKER?=$(shell which docker 2>/dev/null)
+docker-build: BUILD_ARGS?=
+docker-build:
+ @[ -x "$(DOCKER)" ] || \
+ ( echo >&2 "error: Please install Docker first."; exit 1)
+ @$(DOCKER) build --tag $(TAG) $(BUILD_ARGS) .
+ @$(DOCKER) run -it --rm \
+ -v "$(shell pwd):/root/appscope" \
+ --entrypoint /bin/bash \
+ $(TAG) \
+ -c "make all && make test"
