From bcd26a4ae444b56841d2fdc5b44d62c940b95c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 17 Sep 2018 13:51:27 +0200 Subject: [PATCH] Fix (make DISABLE_CGO=1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... which has, apparently, never worked, because the golang image has neither the GOPATH nor the working directory the Makefile expects. Rather than move all this configuration into the Makefile to be able to work with the golang images, just always use the skopeobuildimage path, and only override the tags, to minimize divergence. Signed-off-by: Miloslav Trmač --- Makefile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 612be6c0..b86141e2 100644 --- a/Makefile +++ b/Makefile @@ -55,9 +55,7 @@ LIBDM_BUILD_TAG = $(shell hack/libdm_tag.sh) LOCAL_BUILD_TAGS = $(BTRFS_BUILD_TAG) $(LIBDM_BUILD_TAG) $(DARWIN_BUILD_TAG) BUILDTAGS += $(LOCAL_BUILD_TAGS) -DOCKER_BUILD_IMAGE := skopeobuildimage ifeq ($(DISABLE_CGO), 1) - override DOCKER_BUILD_IMAGE = golang:1.10 override BUILDTAGS = containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp endif @@ -70,18 +68,14 @@ all: binary docs # Build a docker image (skopeobuild) that has everything we need to build. # Then do the build and the output (skopeo) should appear in current dir binary: cmd/skopeo -ifneq ($(DISABLE_CGO), 1) - docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t $(DOCKER_BUILD_IMAGE) . -endif + docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage . docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/containers/skopeo \ - $(DOCKER_BUILD_IMAGE) make binary-local $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' + skopeobuildimage make binary-local $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' binary-static: cmd/skopeo -ifneq ($(DISABLE_CGO), 1) - docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t $(DOCKER_BUILD_IMAGE) . -endif + docker build ${DOCKER_BUILD_ARGS} -f Dockerfile.build -t skopeobuildimage . docker run --rm --security-opt label:disable -v $$(pwd):/src/github.com/containers/skopeo \ - $(DOCKER_BUILD_IMAGE) make binary-local-static $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' + skopeobuildimage make binary-local-static $(if $(DEBUG),DEBUG=$(DEBUG)) BUILDTAGS='$(BUILDTAGS)' # Build w/o using Docker containers binary-local: