Dockerfile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. FROM gliderlabs/alpine:3.4
  2. USER root
  3. # needed for `shadow` package.
  4. RUN echo http://dl-2.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
  5. # bash: for running the guix installation script
  6. # expect: for running the guix installation script without interaction
  7. # gnupg: for checking signatures
  8. # shadow: for having groupadd, useradd and other commands
  9. # wget: for downloading files
  10. # tar: for upgrading the tar version to handle some parameters
  11. # xz: for tar to be able to extract .tar.xz files
  12. # Look here for packages: https://pkgs.alpinelinux.org/packages?name=xz&branch=edge
  13. RUN apk --update upgrade
  14. RUN apk add --no-cache \
  15. ca-certificates \
  16. bash \
  17. expect \
  18. gnupg \
  19. shadow \
  20. wget \
  21. tar \
  22. xz
  23. RUN update-ca-certificates
  24. # Cleanup
  25. RUN rm -rf /var/cache/apk/*
  26. ARG GUIX_SYSTEM="x86_64-linux"
  27. ARG GUIX_VERSION="0.16.0"
  28. # do stuff in /tmp
  29. WORKDIR /tmp
  30. # download the tar ball
  31. RUN wget "https://alpha.gnu.org/gnu/guix/guix-binary-${GUIX_VERSION}.${GUIX_SYSTEM}.tar.xz"
  32. # get the signatures for Guix
  33. RUN wget "https://alpha.gnu.org/gnu/guix/guix-binary-${GUIX_VERSION}.${GUIX_SYSTEM}.tar.xz.sig"
  34. # Note: Network issues when using `pool.sks-keyservers.net` instead of
  35. # `ipv4.pool.sks-keyservers.net`. There is no ipv6 connectivity inside
  36. # the container it seems. For the issue check here:
  37. # https://github.com/nodejs/docker-node/issues/380
  38. ARG KEYSERVER=ipv4.pool.sks-keyservers.net
  39. RUN gpg \
  40. --keyserver "${KEYSERVER}" \
  41. --recv-keys 3CE464558A84FDC69DB40CFB090B11993D9AEBB5
  42. # verify the signatures
  43. RUN gpg --verify "guix-binary-${GUIX_VERSION}.${GUIX_SYSTEM}.tar.xz.sig"
  44. # become root user
  45. USER root
  46. RUN ls -al
  47. # create the GNU store
  48. RUN tar --warning=no-timestamp -xf "guix-binary-${GUIX_VERSION}.${GUIX_SYSTEM}.tar.xz"
  49. RUN rm "guix-binary-${GUIX_VERSION}.${GUIX_SYSTEM}.tar.xz"
  50. RUN mv var/guix /var/ && mv gnu /
  51. # CONTINUE: https://www.gnu.org/software/guix/manual/en/html_node/Binary-Installation.html
  52. # make profile available
  53. mkdir -p ~root/.config/guix
  54. ln -sf /var/guix/profiles/per-user/root/current-guix \
  55. ~root/.config/guix/current
  56. COPY guix-install.sh /
  57. COPY install.sh /
  58. RUN chmod +x /guix-install.sh
  59. RUN chmod +x /install.sh
  60. RUN expect /install.sh