Logo von Thomas Waldecker Software Engineering
Veröffentlichungsdatum

Podman mit Nix, Debian und WSL

Autoren
  • avatar
    Name
    Thomas Waldecker

Erster Versuch nach dem Aufsetzen meiner Entwicklungsmaschine mit Debian Trixie und Nix in WSL. Podman ist dabei nicht im System installiert, sondern wird nur über das Nix-Flake installiert.

podman run -p 9000:9000 -p 9001:9001 \
  quay.io/minio/minio server /data --console-address ":9001"
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
Error: command required for rootless mode with multiple IDs: exec: "newuidmap": executable file not found in $PATH

Ok, es scheint, dass das Programm newuidmap fehlt. Also beim nächsten Versuch habe ich das Paket shadow im Nix Flake installiert und nochmal probiert:

podman run -p 9000:9000 -p 9001:9001 \
  quay.io/minio/minio server /data --console-address ":9001"
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
ERRO[0000] running `/nix/store/dpmwsflrhcx3ymgyrs62nc16pxz97hsl-shadow-4.18.0/bin/newuidmap 3811 0 1000 1 1 100000 65536`: newuidmap: write to uid_map failed: Operation not permitted
Error: cannot set up namespace using "/nix/store/dpmwsflrhcx3ymgyrs62nc16pxz97hsl-shadow-4.18.0/bin/newuidmap": should have setuid or have filecaps setuid: exit status 1

Das hat auch nicht funktioniert. Das newuidmap aus dem Nix Flake funktioniert nicht im Debian System. Das betätigt auch der

Note that rootless podman requires newuidmap (from shadow). If you're not on NixOS, this cannot be supplied by the Nix package 'shadow' since setuid/setgid programs are not currently supported by Nix.

-- https://wiki.nixos.org/wiki/Podman

also aus flake wieder entfernen und in Debian installieren:

sudo apt install uidmap

Neuer Versuch:

podman run -p 9000:9000 -p 9001:9001 \
  quay.io/minio/minio server /data --console-address ":9001"
WARN[0000] "/" is not a shared mount, this could cause issues or missing mounts with rootless containers
WARN[0000] The cgroupv2 manager is set to systemd but there is no systemd user session available
WARN[0000] For using systemd, you may need to log in using a user session
WARN[0000] Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root)
WARN[0000] Falling back to --cgroup-manager=cgroupfs
Error: no policy.json file found at any of the following: "/home/thomas/.config/containers/policy.json", "/etc/containers/policy.json"
WARN[0001] Failed to add pause process to systemd sandbox cgroup: dial unix /run/user/1000/bus: connect: no such file or directory

Die Datei /home/thomas/.config/containers/policy.json fehlt. Also eine unsichere Policy erstellt, damit es erstmal läuft. Merke: diese sollte bei Zeiten in etwas sichereres geändert werden.

❯ cat .config/containers/policy.json
{
    "default": [
        {
            "type": "insecureAcceptAnything"
        }
    ]
}

Und siehe da, es läuft!

podman run -p 9000:9000 -p 9001:9001 \
  quay.io/minio/minio server /data --console-address ":9001"
WARN[0000] The cgroupv2 manager is set to systemd but there is no systemd user session available
WARN[0000] For using systemd, you may need to log in using a user session
WARN[0000] Alternatively, you can enable lingering with: `loginctl enable-linger 1000` (possibly as root)
WARN[0000] Falling back to --cgroup-manager=cgroupfs
Trying to pull quay.io/minio/minio:latest...
Getting image source signatures
Copying blob dd15713b0f22 done   |
Copying blob 02e05d20c69e done   |
Copying blob e14ab7c7ae26 done   |
Copying blob fd312a3c94fc done   |
Copying blob 1f08d9fb7d7d done   |
Copying blob b452b5fb7338 done   |
Copying blob 3bf7f4428838 done   |
Copying blob adc9ba906e83 done   |
Copying blob 1611ffcaf8be done   |
Copying config a98a9d647e done   |
Writing manifest to image destination
INFO: Formatting 1st pool, 1 set(s), 1 drives per set.
INFO: WARNING: Host local has more than 0 drives of set. A host failure will result in data becoming unavailable.
MinIO Object Storage Server
Copyright: 2015-2025 MinIO, Inc.
License: GNU AGPLv3 - https://www.gnu.org/licenses/agpl-3.0.html
Version: RELEASE.2025-07-23T15-54-02Z (go1.24.5 linux/amd64)

API: http://172.31.61.168:9000  http://127.0.0.1:9000
WebUI: http://172.31.61.168:9001 http://127.0.0.1:9001

Docs: https://docs.min.io
WARN: Detected default credentials 'minioadmin:minioadmin', we recommend that you change these values with 'MINIO_ROOT_USER' and 'MINIO_ROOT_PASSWORD' environment variables

Jetzt kann man im Browser die Weboberfläche von MinIO öffnen. Man sieht deutlich, dass es nur noch ein einfacher Objektbrowser ist, da die Firma hinter MinIO einige Funktionen von der Open Source Version gestrichen haben.