forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more refinement of dockerfile & added stack needs
- Loading branch information
Showing
1 changed file
with
21 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,44 @@ | ||
FROM fpco/ubuntu-with-libgmp:14.04 | ||
|
||
# INSTALL PACKAGES | ||
# PACKAGES | ||
ENV DEBIAN_FRONTEND noninteractive | ||
RUN apt-get update | ||
RUN apt-get -y install curl expect | ||
RUN apt-get -y install curl ;# needed to install Nix | ||
RUN apt-get -y install expect ;# needed to automate GPG key trust | ||
RUN apt-get -y install build-essential ;# needed by Stack at runtime | ||
RUN apt-get -y install libgmp-dev ;# needed by Stack at runtime | ||
RUN apt-get -y install xz-utils ;# needed by Stack at runtime | ||
|
||
# CREATE USER | ||
# USER | ||
ENV USER user | ||
ENV HOME /home/$USER | ||
RUN groupadd -r nixbld | ||
RUN useradd -m $USER -G nixbld | ||
RUN useradd -m $USER | ||
|
||
# GPG CONFIG & KEYS | ||
ADD .gnupg/ $HOME/.gnupg/ | ||
RUN chown -R user:user $HOME | ||
RUN chown -R $USER:$USER $HOME | ||
RUN chmod -R go-rwsx $HOME | ||
|
||
# NIX DIR & GROUP | ||
RUN mkdir /nix | ||
RUN chown $USER:nixbld /nix | ||
WORKDIR $HOME | ||
USER $USER | ||
RUN chown -R $USER:$USER /nix | ||
RUN groupadd -r nixbld | ||
|
||
# INSTALL NIX | ||
CMD /bin/bash -l | ||
WORKDIR $HOME | ||
USER $USER | ||
RUN curl -s https://nixos.org/nix/install | sh | ||
RUN echo "\nsource /nix/var/nix/profiles/default/etc/profile.d/nix.sh" \ | ||
| tee -a $HOME/.bash_profile | ||
|
||
# INSTALL GNUPGS & SETUP KEYS | ||
# GNUPG PROFILES | ||
RUN bash -lc "nix-env -p /nix/var/nix/profiles/gpg14 -iA nixpkgs.nix nixpkgs.gnupg1orig" | ||
RUN bash -lc "nix-env -p /nix/var/nix/profiles/gpg20 -iA nixpkgs.nix nixpkgs.gnupg20" | ||
RUN bash -lc "nix-env -p /nix/var/nix/profiles/gpg21 -iA nixpkgs.nix nixpkgs.gnupg" | ||
RUN bash -lc "nix-env -S /nix/var/nix/profiles/gpg14" ;# SET CURRENT PROFILE TO GPG 1.4 | ||
|
||
# IMPORT & TRUST KEYS | ||
RUN bash -lc "gpg --import $HOME/.gnupg/public.asc $HOME/.gnupg/subkey.asc" | ||
RUN bash -lc "expect $HOME/.gnupg/trust" | ||
RUN rm $HOME/.gnupg/*.asc $HOME/.gnupg/trust | ||
|
||
# LOGIN SHELL | ||
CMD /bin/bash -l |