Skip to content

Commit 878dacb

Browse files
committed
use rootless podman
1 parent fc640db commit 878dacb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/dev/setup_ibm_container_runtime.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -Eeou pipefail
3+
set -Eeoux pipefail
44

55
echo "Setting up IBM container runtime (rootless)"
66

@@ -14,6 +14,14 @@ if [[ ! -d "${runtime_dir}" ]]; then
1414
fi
1515
export XDG_RUNTIME_DIR="${runtime_dir}"
1616

17+
# Clean up stale podman state (fixes "cannot re-exec process to join the existing user namespace")
18+
echo "Cleaning up stale podman state..."
19+
pkill -u "$(id -u)" -f "podman" 2>/dev/null || true
20+
rm -rf "${XDG_RUNTIME_DIR}/containers" 2>/dev/null || true
21+
rm -rf "${HOME}/.local/share/containers/storage/libpod" 2>/dev/null || true
22+
podman system migrate 2>/dev/null || true
23+
podman system reset --force 2>/dev/null || true
24+
1725
# Install crun
1826
echo "Installing crun..."
1927
sudo dnf clean all || true

0 commit comments

Comments
 (0)