NixOS Containers: Difference between revisions
No edit summary |
Denperidge (talk | contribs) m Docker container heading change, example config sub-heading & contents placed inside codeblock |
||
| Line 120: | Line 120: | ||
Further informations are available in the {{manual:nixos|sec=#ch-containers|chapter=NixOS manual}}. | Further informations are available in the {{manual:nixos|sec=#ch-containers|chapter=NixOS manual}}. | ||
== Declarative | == Declarative OCI containers (Docker/Podman) == | ||
Example config | === Example config === | ||
<syntaxhighlight lang="nixos"> | |||
{ config, pkgs, ... }: | |||
{ | |||
config.virtualisation.oci-containers.containers = { | |||
hackagecompare = { | |||
image = "chrissound/hackagecomparestats-webserver:latest"; | |||
ports = ["127.0.0.1:3010:3010"]; | |||
volumes = [ | |||
"/root/hackagecompare/packageStatistics.json:/root/hackagecompare/packageStatistics.json" | |||
]; | |||
cmd = [ | |||
"--base-url" | |||
"\"/hackagecompare\"" | |||
]; | |||
}; | }; | ||
} | }; | ||
} | |||
</syntaxhighlight> | |||
== Troubleshooting == | == Troubleshooting == | ||