Skip to content

Support Podman, and Kubernetes in addition to DockerΒ #48

Open
@phreed

Description

echo "Checking if running in docker container..."
if [ -f /.dockerenv ]; then
echo "Docker installation detected.";
IS_DOCKER=true
else
echo "Not running in a container.";
fi

The test for /.dockerenv only works for docker containers.
This could be expanded to work for Podman containers as well.

echo "Checking if running in a container..."
if [ -f /.dockerenv ]; then
    echo "Docker installation detected.";
    IS_DOCKER=true
    IS_CONTAINER=true
elif [ -f /run/.containerenv ]; then
    echo "Podman installation detected.";
    IS_PODMAN=true	
    IS_CONTAINER=true
else
    echo "Not running in a container.";
fi

I do not know what the situation is within a Kubernetes POD.

This would, of course require updating all uses of IS_DOCKER to IS_CONTAINER.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions