Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pure Guix system in a docker image #1

Open
monperrus opened this issue Nov 16, 2020 · 12 comments
Open

pure Guix system in a docker image #1

monperrus opened this issue Nov 16, 2020 · 12 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@monperrus
Copy link

Thanks a lot for the Guix Docker image! It is super useful to experiment with Guix.

Instead of having Alpine + Guix, we could have a pure Guix system as a docker image.

Have you ever seen this?

Thanks! --Martin

@viferga
Copy link
Member

viferga commented Nov 16, 2020

Sure, it's a great idea, I had it written in the TODO list:

guix/TODO

Line 1 in e9a0e79

- Produce a self contained image of Guix inside Docker removing Alpine from base image and using scratch. Possible solution:

It will improve the docker image size and probably we can pack it on a single layer.

Unfortunately I haven't had time to do it yet. PRs are welcome.

@viferga
Copy link
Member

viferga commented Nov 16, 2020

Also I am going to add some documentation as there is people interested on it.

@monperrus
Copy link
Author

Also I am going to add some documentation

Looking forward to it. Would be super useful to give it a try!

@viferga
Copy link
Member

viferga commented Nov 16, 2020

Also I am going to add some documentation

Looking forward to it. Would be super useful to give it a try!

Check it out: https://github.com/metacall/guix/blob/master/README.md

Probably the ease of usage can be improved, I am using it in order to build https://github.com/metacall/core through this project: https://github.com/metacall/distributable , and that's why I haven't improved it too much. But this can change if more people gets interested on it.

@monperrus
Copy link
Author

FYI, I was able to bootstrap a pure guix docker image.

From metacall/guix

guix pack -f docker guix bash coreutils

From the host machine:

docker load < n4l437ih2sg8w3jchry5856vgj8vlapk-docker-pack.tar.gz
docker run -ti guix-bash-coreutils sh

In guix-bash-coreutils this is pure guix, no Alpine anymore.

@viferga
Copy link
Member

viferga commented Nov 23, 2020

Is there any way to run guix pack against current snapshot of guix? I mean, on your example you packaged bash and coreutils, but I would like to package also the fixed version of guix (

COPY channels/ /root/.config/guix/
) and the entry point, so the docker imagen can be seen like a daemonless tool.

Does the resulting image has an user when running? Or are the build users defined (

&& for i in `seq -w 1 10`; do \
)?

@monperrus
Copy link
Author

Is there any way to run guix pack against current snapshot of guix?

I'd say yes, by setting right channel, see https://guix.gnu.org/manual/en/html_node/Channels.html

@monperrus
Copy link
Author

Does the resulting image has an user when running?

I don't think so, there is no file passwd in /etc.

@viferga
Copy link
Member

viferga commented Nov 25, 2020

Does the resulting image has an user when running?

I don't think so, there is no file passwd in /etc.

If it cannot be run, then it is not suitable for CI/CD which is the main objective of this project. I think a good solution may be to use build stages to generate a target (from scratch) with only the Guix dependencies (including Guix itself, among the users and entry point script for allowing to run the daemon).

For example:

FROM alpine AS builder
# ...
FROM scratch AS guix
COPY /gnu /entry-point.sh /etc /

Later on if we want to make it look like a docker image generated by Guix (with a single target), maybe we can find a way for removing the builder target.

@monperrus
Copy link
Author

monperrus commented Nov 26, 2020 via email

@viferga
Copy link
Member

viferga commented Dec 2, 2020

If it cannot be run Yes, it can be run, I tried it :)

Awesome, feel free to implement (and PR) it if you want, or I will try to implement it whenever I have free time.

@viferga viferga added enhancement New feature or request good first issue Good for newcomers labels Oct 15, 2024
@viferga
Copy link
Member

viferga commented Oct 15, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants