Skip to content

Commit

Permalink
more dockerfile tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dysinger committed Mar 31, 2016
1 parent 4f99a13 commit 82a6bdb
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions etc/docker/ubuntu-with-gnupg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
FROM fpco/ubuntu-with-libgmp:14.04

# SETUP GROUP/USERS
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get -y install curl expect

# SETUP A NIX BUILD GROUP & USER
RUN groupadd -r nixbld
RUN useradd -c "Nix Build User" -d /var/empty -g nixbld -G nixbld \
RUN useradd -c "Nix Build" -d /var/empty -g nixbld -G nixbld \
-M -N -r -s "$(which nologin)" nixbld

# INSTALL NIX
RUN apt-get update
RUN apt-get -y install curl
RUN curl -s https://nixos.org/nix/install | USER=root sh
RUN cp /nix/var/nix/profiles/default/etc/profile.d/nix.sh /etc/profile.d/
RUN ln -s /nix/var/nix/profiles/default/etc/profile.d/nix.sh /etc/profile.d/
RUN bash -lc "nix-channel --update"

# INSTALL ALL 3 VERSIONS OF GNUPG INTO SEPARATE PROFILES
RUN bash -lc "nix-env -p /nix/var/nix/profiles/gnupg14 -iA nixpkgs.nix nixpkgs.gnupg1orig"
RUN bash -lc "nix-env -p /nix/var/nix/profiles/gnupg20 -iA nixpkgs.nix nixpkgs.gnupg20"
RUN bash -lc "nix-env -p /nix/var/nix/profiles/gnupg21 -iA nixpkgs.nix nixpkgs.gnupg"
# INSTALL ALL 3 VERSIONS OF GNUPG
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"

# MAKE GNUPG 1 THE DEFAULT PROFILE
RUN bash -lc "nix-env -S /nix/var/nix/profiles/gnupg14"
# MAKE GNUPG 1 THE DEFAULT
RUN bash -lc "nix-env -S /nix/var/nix/profiles/gpg14"

# CREATE USER w/ HOME DIR
RUN useradd -m user
Expand All @@ -29,8 +31,12 @@ RUN chmod -R go-rwsx $HOME
WORKDIR $HOME

# SETUP GPG
RUN apt-get -y install expect
USER user
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

# CLEANUP
RUN apt-mark auto curl expect
RUN apt-get -y autoremove
RUN apt-get -y clean

0 comments on commit 82a6bdb

Please sign in to comment.