From 6fc9d2ebff4e6ce277d2ad4e3c08637e6244a008 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Thu, 4 Jan 2024 21:59:33 -0500 Subject: [PATCH] README.org: Add section about local image usage; cleanup --- README.org | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/README.org b/README.org index 0855b95..10b324c 100644 --- a/README.org +++ b/README.org @@ -46,6 +46,21 @@ Alternatively, ~./shell.sh~ can be invoked directly ~build~ is optional, as its the default target. +* Testing and using the image locally + +The easiest way to use and test the guix-builder container image is to use the provide make +target. + +#+begin_src shell + make run +#+end_src + +Or, if you want to run in a container with no guix store mounted. + +#+begin_src shell + make run-no-store +#+end_src + * Using the image Now that the OCI image has been produced, some care must be taken when running it. Namely, @@ -73,14 +88,13 @@ not required. 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 \ -v /var/lib/ci/guix-cache:/tmp/.cache/guix \ -e HOME=/tmp \ -w /tmp \ guix-builder:latest #+end_src -** Using the image with DroneCI / WoodpeckerCI +** Using the image with Gitea/Forgejo actions or DroneCI/WoodpeckerCI The primary use-case for the image produced by this repository is for ci/cd jobs (mandatorily on a host that is running guix-daemon itself). This allows for the hosts guix store to be @@ -90,29 +104,11 @@ times. Any ci/cd tool that can run OCI containers should be compatible with this image, though the optimal setup assumes it provides a mechanism to mount volumes and set environment variables (by an administrator). Both DroneCI and WoodpeckerCI allow for this, using -~DRONE_RUNNER_VOLUMES~ and ~WOODPECKER_BACKEND_DOCKER_VOLUMES~ respectively. +~DRONE_RUNNER_VOLUMES~ and ~WOODPECKER_BACKEND_DOCKER_VOLUMES~ respectively. Gitea/Forgejo +actions allow it via the ~container.options~ configuration value. Note, in WoodpeckerCI, this functionality has not yet made it into a release (see [[https://github.com/woodpecker-ci/woodpecker/pull/1203][PR]]). -Below is an example of running ~drone-runner-docker~, setup to spawn ~guix~ images produced -by this repository: - -#+begin_src shell - docker run -d \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -e DRONE_RPC_PROTO="https" \ - -e DRONE_RPC_HOST="" \ - -e DRONE_RPC_SECRET="" \ - -e DRONE_RUNNER_CAPACITY=4 \ - -e DRONE_RUNNER_NAME="" \ - -e DRONE_RUNNER_LABELS=guix:on \ - -e DRONE_RUNNER_VOLUMES=/var/guix/daemon-socket/socket:/var/guix/daemon-socket/socket,/gnu/store:/gnu/store,/var/lib/ci/guix-cache:/.cache/guix \ - -p 3001:3000 \ - --restart unless-stopped \ - --name runner-guix \ - drone/drone-runner-docker:1.6.3 -#+end_src - * FAQ ** Why not produce this image with ~guix pack -f docker ...~ directly?