From d1b46ce1299c13618788f9418f04ad100be9ad21 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Thu, 28 Dec 2023 20:55:50 -0500 Subject: [PATCH] Ensure /bin->/guix-builder/bin exists within the container --- .gitignore | 1 + Dockerfile | 5 ++--- Makefile | 10 ++++++++-- manifest-dev.scm | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 335ec95..ee73460 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +*~ *.tar.gz diff --git a/Dockerfile b/Dockerfile index 640af1c..b001c6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -FROM scratch +FROM scratch as builder ADD guix-tarball-pack.tar.gz /guix-builder - -ENV PATH=/guix-builder/bin +ADD links.tar.gz / VOLUME /var/guix/daemon-socket/socket /gnu/store /etc/ssl ENTRYPOINT ["/guix-builder/bin/bash"] diff --git a/Makefile b/Makefile index 973e56e..f204b62 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,20 @@ GUIX_MANIFEST := manifest.scm GUIX_MANIFEST_DEV := manifest-dev.scm TARBALL ?= guix-tarball-pack.tar.gz +LINKS_TARBALL ?= links.tar.gz IMAGE_TAG ?= guix-builder +$(LINKS_TARBALL): + ln -s /guix-builder/bin bin + tar -czvf links.tar.gz bin + rm bin + $(TARBALL): @cp $$(guix pack -R -S /bin=bin -S /etc/ssl=etc/ssl -m $(GUIX_MANIFEST)) $@ @chmod +w $@ .PHONY: build -build: $(TARBALL) +build: $(TARBALL) $(LINKS_TARBALL) @docker build -t $(IMAGE_TAG) . .PHONY: run @@ -30,4 +36,4 @@ shell: .PHONY: clean: - rm $(TARBALL) + rm -r $(TARBALL) $(LINKS_TARBALL) diff --git a/manifest-dev.scm b/manifest-dev.scm index 4fa1847..018e5be 100644 --- a/manifest-dev.scm +++ b/manifest-dev.scm @@ -1,3 +1,4 @@ (specifications->manifest (list "make" + "tar" "docker-cli"))