Podman: Difference between revisions
imported>Mausch Link to nix-shell gist |
imported>Mausch Clarify setuid situation |
||
Line 21: | Line 21: | ||
https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947 | https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947 | ||
Note that rootless podman requires newuidmap which can't come from the shadow Nix package on non-NixOS since [https://nixos.org/manual/nix/unstable/expressions/derivations.html setuid/setgid programs are not currently supported by Nix]. |
Revision as of 16:15, 29 August 2021
Podman can run rootless containers and be a drop-in replacement for Docker.
Install and configure podman with NixOS service configuration
{ pkgs, ... }:
{
virtualisation = {
podman = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
dockerCompat = true;
};
};
}
Use Podman within nix-shell
https://gist.github.com/adisbladis/187204cb772800489ee3dac4acdd9947
Note that rootless podman requires newuidmap which can't come from the shadow Nix package on non-NixOS since setuid/setgid programs are not currently supported by Nix.