Skip to content

Commit

Permalink
fix(podman): rootless setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxd committed Jun 15, 2023
1 parent 5980831 commit 366ee60
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions DevOps/Infrastructure-Solutions/Container/Podman/setup-rootless.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 366ee60

Please sign in to comment.