Skip to content

Instantly share code, notes, and snippets.

@lucabrunox
Last active April 15, 2016 08:21
Show Gist options
  • Save lucabrunox/06f528dfe48ce866de69e66ae44b106b to your computer and use it in GitHub Desktop.
Save lucabrunox/06f528dfe48ce866de69e66ae44b106b to your computer and use it in GitHub Desktop.
{ 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