Podman: Difference between revisions

From NixOS Wiki
imported>Eoli3n
Created page with "== Install podman == <syntaxHighlight lang="nix"> { pkgs, ... }: { environment.systemPackages = with pkgs; [ podman runc conmon slirp4netns fuse-overlayfs ]; } </syntaxHigh..."
 
imported>Eoli3n
No edit summary
Line 11: Line 11:


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
users.users.username.subUidRanges = [{ startUid = 100000; count = 65536; }];
{
users.users.username.subGidRanges = [{ startGid = 100000; count = 65536; }];
  users.users.username.subUidRanges = [{ startUid = 100000; count = 65536; }];
  users.users.username.subGidRanges = [{ startGid = 100000; count = 65536; }];
}


</syntaxHighlight>
</syntaxHighlight>
Line 19: Line 21:


<syntaxHighlight lang="nix">
<syntaxHighlight lang="nix">
environment.etc."containers/policy.json" = {
{
  mode="0644";
  environment.etc."containers/policy.json" = {
  text=''
    mode="0644";
    {
    text=''
      "default": [
      {
        {
        "default": [
          "type": "insecureAcceptAnything"
          {
        }
            "type": "insecureAcceptAnything"
      ],
          }
      "transports":
        ],
        {
        "transports":
          "docker-daemon":
          {
            {
            "docker-daemon":
              "": [{"type":"insecureAcceptAnything"}]
              {
            }
                "": [{"type":"insecureAcceptAnything"}]
        }
              }
    }
          }
  '';
      }
};
    '';
  };


environment.etc."containers/registries.conf" = {
  environment.etc."containers/registries.conf" = {
  mode="0644";
    mode="0644";
  text=''
    text=''
    [registries.search]
      [registries.search]
    registries = ['docker.io', 'quay.io']
      registries = ['docker.io', 'quay.io']
  '';
    '';
};
  };
}
</syntaxHighlight>
</syntaxHighlight>

Revision as of 08:45, 21 January 2020

Install podman

{ pkgs, ... }:
{
  environment.systemPackages = with pkgs; [ podman runc conmon slirp4netns fuse-overlayfs ];
}

Configure subuid/subgid for your user

{
  users.users.username.subUidRanges = [{ startUid = 100000; count = 65536; }];
  users.users.username.subGidRanges = [{ startGid = 100000; count = 65536; }];
}

Create configuration files

{
  environment.etc."containers/policy.json" = {
    mode="0644";
    text=''
      {
        "default": [
          {
            "type": "insecureAcceptAnything"
          }
        ],
        "transports":
          {
            "docker-daemon":
              {
                "": [{"type":"insecureAcceptAnything"}]
              }
          }
      }
    '';
  };

  environment.etc."containers/registries.conf" = {
    mode="0644";
    text=''
      [registries.search]
      registries = ['docker.io', 'quay.io']
    '';
  };
}