36 lines
696 B
Nix
36 lines
696 B
Nix
{ pkgs, ... }:
|
|
let
|
|
entrypoint = pkgs.writeTextFile {
|
|
name = "entrypoint";
|
|
executable = true;
|
|
destination = "/bin/entrypoint";
|
|
text = builtins.readFile ./entrypoint.sh;
|
|
};
|
|
in
|
|
pkgs.dockerTools.buildImage {
|
|
name = "prometheus";
|
|
fromImage = import ../base { inherit pkgs; };
|
|
|
|
copyToRoot = pkgs.buildEnv {
|
|
name = "root";
|
|
paths = with pkgs; [
|
|
entrypoint
|
|
prometheus
|
|
yq-go
|
|
];
|
|
pathsToLink = [ "/bin" ];
|
|
};
|
|
|
|
config = {
|
|
Entrypoint = [ "entrypoint" ];
|
|
ExposedPorts = {
|
|
"9090/tcp" = { };
|
|
};
|
|
WorkingDir = "/var/lib/prometheus";
|
|
Volumes = {
|
|
"/etc/prometheus" = { };
|
|
"/var/lib/prometheus" = { };
|
|
};
|
|
};
|
|
}
|