git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/docker: explicitly load kernel modules

This is analogous to #70447. With security.lockKernelModules=true, docker commands result in the following error without at least loading veth: $ docker run hello-world /nix/store/mr50kaan2vs4gc40ymwncb2vci25aq7z-docker-19.03.2/libexec/docker/docker: Error response from daemon: failed to create endpoint epic_kare on network bridge: failed to add the host (veth8b381f3) <=> sandbox (veth348e197) pair interfaces: operation not supported. ERRO[0003] error waiting for container: context canceled

commitf12581a7a3378a4becd3ae04dba785c777695dcd authorryneeverett <ryneeverett@gmail.com> dateWed 25 Dec 2019, 06:16 (7 years ago) parent87979bb
1 file changed+1
nixos/modules/virtualisation/docker.nix+1
nixos/modules/virtualisation/docker.nix+1
@@ -149,6 +149,7 @@ in
149149 ###### implementation
150150
151151 config = mkIf cfg.enable (mkMerge [{
152+ boot.kernelModules = [ "bridge" "veth" ];
152153 environment.systemPackages = [ cfg.package ]
153154 ++ optional cfg.enableNvidia pkgs.nvidia-docker;
154155 users.groups.docker.gid = config.ids.gids.docker;