guix docker image
This commit is contained in:
parent
53d2dbda5d
commit
eb56a9c5a5
|
@ -0,0 +1,32 @@
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
# Add Tini
|
||||||
|
ENV TINI_VERSION v0.8.3
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
|
||||||
|
RUN chmod +x /tini
|
||||||
|
ADD ./entrypoint.sh /
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
|
ENV GUIX_VERSION 0.9.0
|
||||||
|
ENV PATH $PATH:/var/guix/profiles/default/guix-profile/bin
|
||||||
|
|
||||||
|
# update to edge
|
||||||
|
ADD repositories /etc/apk/repositories
|
||||||
|
RUN apk update && apk upgrade
|
||||||
|
|
||||||
|
# install guix in one pass
|
||||||
|
RUN set -x && apk update && apk add xz tar wget runit \
|
||||||
|
&& wget ftp://alpha.gnu.org/gnu/guix/guix-binary-0.9.0.x86_64-linux.tar.xz -O guix.tar.xz \
|
||||||
|
&& tar xJf guix.tar.xz \
|
||||||
|
&& rm guix.tar.xz \
|
||||||
|
&& addgroup guixbuild \
|
||||||
|
&& chmod 1775 /gnu/store \
|
||||||
|
&& ln -sf /var/guix/profiles/per-user/root/guix-profile ~root/.guix-profile \
|
||||||
|
&& mkdir -p /usr/local/bin \
|
||||||
|
&& cd /usr/local/bin \
|
||||||
|
&& ln -s /var/guix/profiles/per-user/root/guix-profile/bin/guix \
|
||||||
|
&& guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub \
|
||||||
|
&& adduser -S guix-builder guix-builder \
|
||||||
|
&& adduser guix-builder guixbuild
|
||||||
|
|
||||||
|
ADD runit/ /etc/system
|
|
@ -0,0 +1,14 @@
|
||||||
|
# Guix in Docker
|
||||||
|
|
||||||
|
Guix is cool, so is Docker, why not combine them?
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker build -t xena/guix .
|
||||||
|
$ docker run --rm -it --privileged xena/guix /bin/sh
|
||||||
|
$ pstree
|
||||||
|
tini-+-runsvdir---runsv---run---guix-daemon
|
||||||
|
`-sh---pstree
|
||||||
|
$ guix package --install hello
|
||||||
|
$ hello
|
||||||
|
Hello, world!
|
||||||
|
```
|
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
runsvdir /etc/system &
|
||||||
|
|
||||||
|
exec /tini -- $*
|
|
@ -0,0 +1,2 @@
|
||||||
|
http://dl-4.alpinelinux.org/alpine/edge/main
|
||||||
|
http://dl-4.alpinelinux.org/alpine/edge/testing
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
~root/.guix-profile/bin/guix-daemon --build-users-group=guixbuild
|
Loading…
Reference in New Issue