Skip to content

Commit c8be975

Browse files
pillar/Makefile: fix $(shell ) build-docker-test
$(shell ...) is evaluated immediately and not on the line it is executed on, therefore build-docker-test needs to be split into three different targets otherwise an error message like this shows up: ``` Dockerfile:19 -------------------- 17 | 18 | FROM ${REL_HASH_LFEDGE_EVE_UEFI} AS uefi-build 19 | >>> FROM ${REL_HASH_LFEDGE_EVE_DOM0_ZTOOLS} AS zfs 20 | RUN mkdir /out 21 | # copy zfs-related files from dom0-ztools using prepared list of files -------------------- ERROR: failed to build: failed to solve: lfedge/eve-dom0-ztools:000adaabe42b4f34dc196b722f143d3ae39f47fa-dirty-cb3d84e: failed to resolve source metadata for docker.io/lfedge/eve-dom0-ztools:000adaabe42b4f34dc196b722f143d3ae39f47fa-dirty-cb3d84e: docker.io/lfedge/eve-dom0-ztools:000adaabe42b4f34dc196b722f143d3ae39f47fa-dirty-cb3d84e: not found ``` Signed-off-by: Christoph Ostarek <[email protected]>
1 parent bc555e9 commit c8be975

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pkg/pillar/Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ZARCH ?= $(HOSTARCH)
1010
DISTDIR := dist/$(ZARCH)
1111
BUILD_VERSION ?=
1212

13+
DOCKER_LIKE_LKT:= ../../build-tools/bin/linuxkit pkg build --network --platforms linux/$(ZARCH) --dry-run --force ./ | tail -n1 | perl -pe 's/ buildx / /g'
1314
DOCKER_TAG:=lfedge/eve-pillar:local-$(ZARCH)
1415

1516
APPS = zedbox
@@ -66,18 +67,18 @@ $(APPS1): $(DISTDIR)
6667
shell:
6768
make -C ../.. shell
6869

69-
build-docker build-docker-test: DOCKER_LIKE_LKT = $(shell ../../build-tools/bin/linuxkit pkg build --network --platforms linux/$(ZARCH) --dry-run --force ./ | tail -n1 | perl -pe 's/ buildx / /g')
70-
7170
build-docker:
72-
$(DOCKER_LIKE_LKT) -t $(DOCKER_TAG)
71+
$(shell $(DOCKER_LIKE_LKT)) -t $(DOCKER_TAG)
7372

7473
enter-docker-dev: build-docker-test
7574
docker run --platform linux/$(ZARCH) -it --rm --entrypoint /bin/sh $(DOCKER_TAG)
7675

77-
build-docker-test:
76+
build-docker-test-dependencies:
7877
make -C ../../ pillar-cache-export-docker-load
79-
$(DOCKER_LIKE_LKT) --build-arg TEST_TOOLS=y --load --target build
80-
docker image tag $(shell $(DOCKER_LIKE_LKT) --build-arg TEST_TOOLS=y --load -q --target build) $(DOCKER_TAG)
78+
build-docker-test-build: build-docker-test-dependencies
79+
$(shell $(DOCKER_LIKE_LKT)) --build-arg TEST_TOOLS=y --load --target build
80+
build-docker-test: build-docker-test-build
81+
docker image tag $(shell $(shell $(DOCKER_LIKE_LKT)) --build-arg TEST_TOOLS=y --load -q --target build) $(DOCKER_TAG)
8182

8283
test: build-docker-test
8384
rm -f results.json

0 commit comments

Comments
 (0)