Created
April 13, 2016 22:08
-
-
Save lucabrunox/69f13ac0077194c03094e8bc8c3d6805 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
cp /etc/pam.d/other /etc/pam.d/su | |
''; | |
config = { | |
Cmd = [ "${shadow.su}/bin/su" "redis" "-c" "${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