File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,27 @@ if [ -n "${PATTERN_DISCONNECTED_HOME}" ]; then
2222 echo " PATTERN_INSTALL_CHART: ${PATTERN_INSTALL_CHART} "
2323fi
2424
25+ function is_running_in_container {
26+ # Check if we're running inside a podman container
27+ # Podman creates /run/.containerenv in all containers (rootful and rootless)
28+ if [ -f /run/.containerenv ]; then
29+ return 0
30+ fi
31+ # Use systemd-detect-virt if available to detect container environment
32+ if command -v systemd-detect-virt > /dev/null 2>&1 ; then
33+ if systemd-detect-virt --container > /dev/null 2>&1 ; then
34+ return 0
35+ fi
36+ fi
37+ return 1
38+ }
39+
40+ # If already running in a container, execute the command directly
41+ if is_running_in_container; then
42+ echo " Detected running inside a container, executing command directly..."
43+ exec " $@ "
44+ fi
45+
2546readonly commands=(podman)
2647for cmd in ${commands[@]} ; do is_available " $cmd " ; done
2748
You can’t perform that action at this time.
0 commit comments