Skip to content

Commit 1b19cc6

Browse files
committed
WIP add "binaries" target
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent c3a14ed commit 1b19cc6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

deb/Makefile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ GO_IMAGE=$(GO_BASE_IMAGE):$(GO_VERSION)-stretch
1010
DEB_VERSION=$(shell ./gen-deb-ver $(CLI_DIR) "$(VERSION)")
1111
CHOWN:=docker run --rm -v $(CURDIR):/v -w /v alpine chown
1212
EPOCH?=5
13+
DOCKER_BUILDKIT=1
14+
BUILD_TARGET=final
1315

1416
ifdef BUILD_IMAGE
1517
BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
@@ -20,6 +22,11 @@ BUILD?=docker build \
2022
$(BUILD_IMAGE_FLAG) \
2123
--build-arg GO_IMAGE=$(GO_IMAGE) \
2224
--build-arg COMMON_FILES=$(COMMON_FILES) \
25+
--build-arg VERSION=$(word 2, $(DEB_VERSION)) \
26+
--build-arg DOCKER_GITCOMMIT=$(GITCOMMIT) \
27+
--build-arg PLATFORM \
28+
--target=$(BUILD_TARGET) \
29+
$(BUILD_OPTS) \
2330
-t debbuild-$@/$(ARCH) \
2431
-f $(CURDIR)/$@/Dockerfile .
2532
# Additional flags may be necessary at some point
@@ -61,6 +68,12 @@ engine-$(ARCH).tar:
6168
.PHONY: deb
6269
deb: ubuntu debian ## build all deb packages except for raspbian
6370

71+
.PHONY: binaries
72+
binaries: BUILD_TARGET=binaries
73+
binaries: BUILD_OPTS=--output type=local,dest=build
74+
binaries: deb
75+
76+
6477
.PHONY: ubuntu
6578
ubuntu: $(UBUNTU_VERSIONS) ## build all ubuntu deb packages
6679

@@ -74,8 +87,8 @@ raspbian: $(RASPBIAN_VERSIONS) ## build all raspbian deb packages
7487
$(DISTROS): $(SOURCES)
7588
@echo "== Building packages for $@ =="
7689
$(BUILD)
77-
$(RUN)
78-
$(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
90+
# $(RUN)
91+
# $(CHOWN) -R $(shell id -u):$(shell id -g) debbuild/$@
7992

8093
sources/engine.tgz:
8194
mkdir -p $(@D)

0 commit comments

Comments
 (0)