From 0b97bde2cb04cf5e23350798f972abcee4bfe4ee Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Sun, 26 Nov 2023 09:25:01 -0600 Subject: image-tools: T4516: exit grub-update service if running in docker --- python/vyos/system/image.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/vyos') 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 -- cgit v1.2.3