File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -729,13 +729,19 @@ prompt_pure_state_setup() {
729729
730730# Return true if executing inside a Docker, OCI, LXC, or systemd-nspawn container.
731731prompt_pure_is_inside_container () {
732- local -r cgroup_file=' /proc/1/cgroup'
733732 local -r nspawn_file=' /run/host/container-manager'
734- [[ -r " $cgroup_file " && " $( < $cgroup_file ) " = * (lxc| docker)* ]] \
735- || [[ " $container " == " lxc" ]] \
733+ local -r podman_crio_file=' /run/.containerenv'
734+ local -r docker_file=' /.dockerenv'
735+ local -r k8s_token_file=' /var/run/secrets/kubernetes.io/serviceaccount/token'
736+ local -r cgroup_file=' /proc/1/cgroup'
737+ [[ " $container " == " lxc" ]] \
736738 || [[ " $container " == " oci" ]] \
737739 || [[ " $container " == " podman" ]] \
738- || [[ -r " $nspawn_file " ]]
740+ || [[ -r " $nspawn_file " ]] \
741+ || [[ -r " $podman_crio_file " ]] \
742+ || [[ -r " $docker_file " ]] \
743+ || [[ -r " $k8s_token_file " ]] \
744+ || [[ -r " $cgroup_file " && " $( < $cgroup_file ) " = * (lxc| docker| containerd)* ]]
739745}
740746
741747prompt_pure_system_report () {
You can’t perform that action at this time.
0 commit comments