Skip to content

Commit

Permalink
build per-user yq container
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Volchkov <yuri@volch.org>
  • Loading branch information
Yuri Volchkov committed Aug 3, 2022
1 parent 3684ef6 commit 054d891
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ QEMU_OPTS=$(QEMU_OPTS_COMMON) $(QEMU_ACCEL) $(QEMU_OPTS_$(ZARCH)) $(QEMU_OPTS_CO
GOOS=linux
CGO_ENABLED=1
GOBUILDER=eve-build-$(shell echo $(USER) | tr A-Z a-z)
YQ=yq-$(shell echo $(USER) | tr A-Z a-z)

# if proxy is set, use it when building docker builder
ifneq ($(HTTP_PROXY),)
Expand Down Expand Up @@ -661,6 +662,10 @@ ifneq ($(BUILD),local)
endif
$(QUIET): $@: Succeeded

$(YQ):
@echo "Creating go builder image for user $(USER)"
$(QUIET)docker build git@github.com:yvolchkov/yq.git \
--build-arg USER_ID=$(UID) --build-arg GROUP_ID=$(GID) -t $@
#
# Common, generalized rules
#
Expand Down Expand Up @@ -696,7 +701,7 @@ eve-%: pkg/%/Dockerfile build-tools $(RESCAN_DEPS)
$(QUIET)if [ -n "$(PRUNE)" ]; then docker image prune -f; fi
$(QUIET): "$@: Succeeded (intermediate for pkg/%)"

images/rootfs-%.yml.in: images/rootfs.yml.in FORCE
images/rootfs-%.yml.in: images/rootfs.yml.in $(YQ) FORCE
$(QUITE)tools/compose-image-yml.sh $< $@ "$(ROOTFS_VERSION)-$*-$(ZARCH)"

images-patches := $(wildcard images/*.patch)
Expand Down
2 changes: 1 addition & 1 deletion tools/compose-image-yml.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

yq() {
docker run --rm -i -v "${PWD}":/workdir mikefarah/yq "$@"
docker run --rm -i -v "${PWD}":/workdir yq-"${USER}" "$@"
}

process-image-template() {
Expand Down

0 comments on commit 054d891

Please sign in to comment.