Last active
April 15, 2016 08:21
-
-
Save lucabrunox/06f528dfe48ce866de69e66ae44b106b to your computer and use it in GitHub Desktop.
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
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
dockerTools.buildImage { | |
name = "redis"; | |
runAsRoot = '' | |
#!${stdenv.shell} | |
${dockerTools.shadowSetup} | |
groupadd -r redis | |
useradd -r -g redis -d /data -M redis | |
mkdir /data | |
chown redis:redis /data | |
''; | |
config = { | |
Cmd = [ "${goPackages.gosu.bin}/bin/gosu" "redis" "${redis}/bin/redis-server" ]; | |
ExposedPorts = { | |
"6379/tcp" = {}; | |
}; | |
WorkingDir = "/data"; | |
Volumes = { | |
"/data" = {}; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment