summaryrefslogtreecommitdiff
path: root/python/vyos/system
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-11-26 09:25:01 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-11-26 09:25:01 -0600
commit0b97bde2cb04cf5e23350798f972abcee4bfe4ee (patch)
tree6cd19bf6b0f536a94f36253f6d7c561b339338d3 /python/vyos/system
parent6afd6eeb87a3a4ecbbd5aa9c67622d0b3c27721c (diff)
downloadvyos-1x-0b97bde2cb04cf5e23350798f972abcee4bfe4ee.tar.gz
vyos-1x-0b97bde2cb04cf5e23350798f972abcee4bfe4ee.zip
image-tools: T4516: exit grub-update service if running in docker
Diffstat (limited to 'python/vyos/system')
-rw-r--r--python/vyos/system/image.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/vyos/system/image.py b/python/vyos/system/image.py
index 6c4e3bba5..c03ce02d5 100644
--- a/python/vyos/system/image.py
+++ b/python/vyos/system/image.py
@@ -261,3 +261,8 @@ def is_live_boot() -> bool:
if boot_type == 'live':
return True
return False
+
+def is_running_as_container() -> bool:
+ if Path('/.dockerenv').exists():
+ return True
+ return False