From ec810c91febcbffa3ff61cd5eab352bbcb7db9bb Mon Sep 17 00:00:00 2001 From: ERAMOTO Masaya Date: Tue, 15 Jan 2019 18:47:25 +0900 Subject: [PATCH] Makefile: Build docs in a container Enables to build docs in a container even when go-md2man is not installed locally. Signed-off-by: ERAMOTO Masaya --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b30da391..9d3b132c 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all binary build-container docs build-local clean install install-binary install-completions shell test-integration vendor +.PHONY: all binary build-container docs docs-in-container build-local clean install install-binary install-completions shell test-integration vendor export GO15VENDOREXPERIMENT=1 @@ -65,7 +65,7 @@ endif # Note: Uses the -N -l go compiler options to disable compiler optimizations # and inlining. Using these build options allows you to subsequently # use source debugging tools like delve. -all: binary docs +all: binary docs-in-container # Build a container image (skopeobuild) that has everything we need to build. # Then do the build and the output (skopeo) should appear in current dir @@ -94,6 +94,11 @@ docs/%.1: docs/%.1.md docs: $(MANPAGES_MD:%.md=%) +docs-in-container: + ${CONTAINER_RUNTIME} build ${BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage . + ${CONTAINER_RUNTIME} run --rm --security-opt label=disable -v $$(pwd):/src/github.com/containers/skopeo \ + skopeobuildimage make docs $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' + clean: rm -f skopeo docs/*.1