ops... I lied. To be fair, I described how to run a Docker service inside Guix. So it is more a workaround, than an elegant solution.

But it is a relief knowing that when a service is not yet ported to Guix, there is still a plan-b.

@mzan Cool!

Naive question: Instead of,

FROM debian:latest

and some,

RUN apt-get install -y make git sqlite3 libsqlite3-dev bash curl coreutils util-linux

why not build using Guix a Docker thing containing that? E.g.,

guix pack -f docker make git sqlite3 libsqlite3-dev bash curl coreutils util-linux --image-tag=guix

FROM guix
COPY …
COPY …
RUN cd / && rm …
VOLUME /writefreely-data

This way, the only part you don’t fully control with Guix is about writefreely_0.15.1_linux_amd64.tar.gz, no?

@zimoun I should try, because I nevere used "guix pack".

On the same line, before writing the post, I tried also with

guix shell --container --emulate-fhs bash coreutils sqlite

and the pre-compiled Writefreely binary was running inside this shell.

Probably, I can also create directly a Guix system container with the pre-compiled binary, without using Docker altogether.

In any case, I discarded all these reasonable and more elegant intermediate solutions, and I opted for a full "desperate-mode" solution based completely on Docker, because before this, I spent some time trying to package Writefreely without success. So I were burn-out.

This approach is feasible also for all other services with a more complex Dockerfile.

@mzan Well, usually my workflow’s to first go with “guix shell -CF” and if all is fine then to pack this environment with “guix pack”. IMHO, Docker’s helpul because based on the image produced by “guix pack”, I can write a Dockerfile that describe the sequence of commands I typed inside “guix shell -CF”.

Yeah, create something with Guix System’d be nice but it’s much more work! And sometimes, I prefer too having something half-baked but working than having nothing. 😀

@mzan This is cool. To do this in a foreign distro (with guix installed) I would need to setup shepherd right?, I want to try this with a few podman containers.

@mirkoh I'm not expert enough to answer. BTW, I'm using Guix both on my local workstation, and for a cloud server, that I administer using "guix deploy". The fact of having a unique declarative configuration file, is a selling point, and probably this cannot be maintained in your case.

In case of a foreign distro, probably the best approach is installing a Writefreely container, without using Guix altogether.

For other services already packaged for Guix, you can also define a Guix system and tell to Guix to generate an OCI container, and then install the container on your host. I never tried this path.

Guix is not mainstream, but it is rather flexible.

@mzan Thanks for describing your setup. I'm just using an old laptop with alpine, guix and a few podman containers (docker files running on podman). I would like to manage them using guix deploy; your article seems really good starting point to try something similar.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.