hw accell and device mapper container for dev/dri usage in swarm
This commit is contained in:
32
docker-device-mapper.nix
Normal file
32
docker-device-mapper.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.oci-containers = {
|
||||
# Specify Docker as the backend engine
|
||||
backend = "docker";
|
||||
|
||||
# Define your containers
|
||||
containers = {
|
||||
device-manager = {
|
||||
image = "ndouba/device-mapping-manager";
|
||||
|
||||
# Equivalent to --restart always
|
||||
autoStart = true;
|
||||
|
||||
privileged = true;
|
||||
volumes = [
|
||||
"/sys:/host/sys"
|
||||
"/var/run/docker.sock:/var/run/docker.sock"
|
||||
];
|
||||
|
||||
# Use extraOptions for flags not directly mapped to NixOS options
|
||||
extraOptions = [
|
||||
"--pid=host" # --pid=host
|
||||
"--cgroupns=host" # --cgroupns=host
|
||||
"--userns=host" # --userns=host
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user