=============== LIBRARY RULES =============== From library maintainers: - Import is_inside_container from container_detect. It always returns False on macOS and Windows. - The result is cached; call is_inside_container(force_refresh=True) to check again. ### Install container-detect with pip Source: https://github.com/ysskrishna/container-detect/blob/main/README.md Install the container-detect package using pip. This is the standard installation method for Python packages. ```bash pip install container-detect ``` -------------------------------- ### Install container-detect with uv Source: https://github.com/ysskrishna/container-detect/blob/main/README.md Alternative installation method using the uv package manager. Use this if you prefer uv over pip. ```bash uv add container-detect ``` -------------------------------- ### API Reference example for is_inside_container Source: https://github.com/ysskrishna/container-detect/blob/main/README.md Example from the API reference section showing the function's usage. The comments indicate the expected return values (False) when not inside a container. ```python from container_detect import is_inside_container is_inside_container() # False (Uses cache) is_inside_container(force_refresh=True) # False (Bypasses cache) ``` -------------------------------- ### Force refresh cache for container detection Source: https://github.com/ysskrishna/container-detect/blob/main/README.md Demonstrates using is_inside_container() with and without the force_refresh parameter. By default, results are cached; setting force_refresh=True bypasses the cache and performs a new detection. ```python from container_detect import is_inside_container # Use cached result (default) is_inside_container() # Fast, uses cache # Force a fresh check, bypassing cache is_inside_container(force_refresh=True) # Performs new detection ``` -------------------------------- ### is_inside_container(force_refresh: bool = False) -> bool Source: https://github.com/ysskrishna/container-detect/blob/main/README.md Returns True if the current process is running inside a container. Detects multiple container types including Docker, Podman, Kubernetes, containerd, LXC, and others. Linux-only detection; returns False on macOS and Windows. ```APIDOC ## is_inside_container(force_refresh: bool = False) -> bool ### Description Returns True if the current process is running inside a container. Detects multiple container types including Docker, Podman, Kubernetes, containerd, LXC, and others. Linux-only detection; returns False on macOS and Windows. ### Parameters - `force_refresh` (bool) - Optional - If True, bypass the cache and perform a fresh check. Defaults to False. ### Returns - True if running inside a container, False otherwise. ### Example ```python from container_detect import is_inside_container is_inside_container() # False (Uses cache) is_inside_container(force_refresh=True) # False (Bypasses cache) ``` ``` -------------------------------- ### Check if running inside a container Source: https://github.com/ysskrishna/container-detect/blob/main/README.md Use the is_inside_container() function to check if the current process is running inside a container. Prints a message based on the result. ```python from container_detect import is_inside_container if is_inside_container(): print("Running inside a container") else: print("Not running inside a container") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.