Last active
April 9, 2016 21:55
-
-
Save aespinosa/6c979bebfda9d78b181a95e08524ef72 to your computer and use it in GitHub Desktop.
building a nix docker image
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
with import <nixpkgs> {}; | |
let | |
niximage = dockerTools.buildImage { | |
name = "nix"; | |
tag = "1.11.2"; | |
contents = [ nix cacert bash ]; | |
}; | |
nixpkgs = import /nix/store/xxxxx-nixpkgs.drv; | |
in | |
dockerTools.buildImage { | |
name = "nix"; | |
tag = "1.11.2"; | |
fromImage = niximage; | |
runAsRoot = '' | |
#!${stdenv.shell} | |
set -xe | |
${dockerTools.shadowSetup} | |
mkdir -p /home | |
useradd -m user | |
mkdir /tmp && chmod 777 /tmp | |
''; | |
config = { | |
User = "user"; | |
Env = ["HOME=/home/user" "NIX_PATH=nixpkgs=/nixpkgs" "SSL_CERT_FILE=/etc/ssl/certs/ca-bundle.crt"]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment