Collin J. Doering
86f051167b
Unbeknownst to me, the docker image produced by previous versions of guix-builder actually had a hidden dependency on the hosts /gnu/store. I have not been able to fully characterize it, but the following proves it to be true. This fails with an error 139, segfault: docker run -it guix-builder:latest However it succeeds when provided the hosts guix store: docker run -it -v /gnu/store:/gnu/store:ro guix-builder:latest By using GUIX_EXECUTION_ENGINE=proot (which is implied by the '-RR' option to 'guix pack'), we avoid the segfaults and hidden dependency on the hosts /gnu/store. Sadly using proot will have performance impacts, but I'm not sure yet to what extent this will impact my usecase.
44 lines
963 B
Makefile
44 lines
963 B
Makefile
.DEFAULT_GOAL := build
|
|
|
|
GUIX_MANIFEST := manifest.scm
|
|
GUIX_MANIFEST_DEV := manifest-dev.scm
|
|
|
|
TARBALL ?= guix-tarball-pack.tar.gz
|
|
LINKS_TARBALL ?= links.tar.gz
|
|
PASSWD_FILE ?= passwd
|
|
IMAGE_TAG ?= guix-builder
|
|
|
|
$(PASSWD_FILE):
|
|
echo 'root:x:0:0:root:/root:/bin/sh' > passwd
|
|
|
|
$(LINKS_TARBALL):
|
|
ln -s /guix-builder/bin bin
|
|
tar -czvf $@ bin
|
|
rm bin
|
|
|
|
$(TARBALL):
|
|
@cp $$(guix pack -RR -S /bin=bin -S /etc/ssl=etc/ssl -m $(GUIX_MANIFEST)) $@
|
|
@chmod +w $@
|
|
|
|
.PHONY: build
|
|
build: $(TARBALL) $(LINKS_TARBALL) $(PASSWD_FILE)
|
|
@docker build -t $(IMAGE_TAG) .
|
|
|
|
.PHONY: run
|
|
run: build
|
|
@docker run --rm -it \
|
|
-v /var/guix/daemon-socket/socket:/var/guix/daemon-socket/socket \
|
|
-v /gnu/store:/gnu/store:ro \
|
|
-v /etc/ssl:/etc/ssl:ro \
|
|
-e HOME=/tmp \
|
|
-w /tmp \
|
|
$(IMAGE_TAG):latest
|
|
|
|
.PHONY: shell
|
|
shell:
|
|
@./shell.sh $(GUIX_MANIFEST) $(GUIX_MANIFEST_DEV)
|
|
|
|
.PHONY:
|
|
clean:
|
|
rm -r $(TARBALL) $(LINKS_TARBALL) $(PASSWD_FILE)
|