-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.step1.base
42 lines (32 loc) · 1.53 KB
/
Dockerfile.step1.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# https://willschenk.com/articles/2019/installing_guix_on_nuc/
FROM alpine:3.12 AS guix-package-manager
ARG GUIX_VERSION=1.2.0
ENV GUIX_VERSION $GUIX_VERSION
ARG BUILD_FOR_SYSTEM=i686-linux
ENV BUILD_FOR_SYSTEM $BUILD_FOR_SYSTEM
# Add packages required to install Guix during docker build
RUN apk add --no-cache gnupg xz
# TODO: create Guix PRs that remove the need for these
# Add python3, git to modify docker metadata files and look up datetime of commit
RUN apk add --no-cache python3 git
# create users and user group for Guix builder
RUN addgroup -S guixbuild \
&& for i in `seq -w 1 10`; \
do \
adduser -S -G guixbuild -h /var/empty -s `which nologin` -g "Guix build user $i" guixbuilder$i; \
addgroup guixbuilder$i kvm; \
done
# Import GPG key
RUN wget -q -O - "https://sv.gnu.org/people/viewgpg.php?user_id=15145" | gpg --import -
# TODO: gpg --verify /tmp/guix-bootstrap.tar.xz
RUN wget -q -O /tmp/guix-bootstrap.tar.xz https://ftp.gnu.org/gnu/guix/guix-binary-${GUIX_VERSION}.${BUILD_FOR_SYSTEM}.tar.xz \
&& cat /tmp/guix-bootstrap.tar.xz | xz -d | tar x -C / \
&& rm -f /tmp/guix-bootstrap.tar.xz \
&& mkdir -p /root/.config/guix \
&& ln -sf /var/guix/profiles/per-user/root/current-guix /root/.config/guix/current \
&& mkdir -p /usr/local/bin \
&& ln -sf /var/guix/profiles/per-user/root/current-guix/bin/guix /usr/local/bin/guix \
&& guix archive --authorize < /root/.config/guix/current/share/guix/ci.guix.gnu.org.pub
FROM guix-package-manager AS release
VOLUME ["/output"]
VOLUME ["/scripts"]