kubes/image.nix

20 lines
496 B
Nix
Raw Permalink Normal View History

2021-01-08 11:19:09 +00:00
{ dockerTools, nginx }:
dockerTools.buildLayeredImage {
name = "nginx";
contents = [ nginx ];
2021-01-08 12:06:05 +00:00
# also we log to stderr, it still needs /var/log/nginx on start
2021-01-08 11:19:09 +00:00
extraCommands = ''
2021-01-08 12:06:05 +00:00
mkdir -p etc var/cache/nginx var/log/nginx
chmod u+w etc var/cache/nginx var/log/nginx
2021-01-08 11:19:09 +00:00
echo "nginx:x:1000:1000::/:" > etc/passwd
echo "nginx:x:1000:nginx" > etc/group
'';
config = {
Cmd = ["nginx" "-c" "/etc/nginx/nginx.conf"];
ExposedPorts = {
"8383/tcp" = {};
};
};
}