From 366ee60701a93c6d18a21fe4e01c86c1415a7200 Mon Sep 17 00:00:00 2001 From: rwxd Date: Thu, 15 Jun 2023 18:57:51 +0200 Subject: [PATCH] fix(podman): rootless setup --- .../Container/Podman/setup-rootless.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 DevOps/Infrastructure-Solutions/Container/Podman/setup-rootless.md diff --git a/DevOps/Infrastructure-Solutions/Container/Podman/setup-rootless.md b/DevOps/Infrastructure-Solutions/Container/Podman/setup-rootless.md new file mode 100644 index 00000000..6e29bebe --- /dev/null +++ b/DevOps/Infrastructure-Solutions/Container/Podman/setup-rootless.md @@ -0,0 +1,30 @@ +# Podman rootless setup + +## Install podman + +```bash +dnf install -y podman podman-docker +``` + +## Enable low ports + +```bash +if ! grep -q "net.ipv4.ip_unprivileged_port_start=80" /etc/sysctl.conf; then echo "net.ipv4.ip_unprivileged_port_start=80" >> /etc/sysctl.conf; fi + +# Reload sysctl +sysctl --system +``` +## Create user + +```bash +useradd -m -s /bin/bash container +sudo -iu container +``` + +## Create podman socket + +```bash +if ! grep -q "loginctl enable-linger" ~/.bashrc; then echo "loginctl enable-linger $(whoami)" >> ~/.bashrc; fi +if ! grep -q "$temp" ~/.bashrc; then echo "XDG_RUNTIME_DIR=/run/user/$(id -u)" >> ~/.bashrc; fi +source ~/.bashrc +```