docker=$(cat /proc/self/cgroup | awk -F/ '$2 == "docker"') if [ ! -z "$docker" ]; then echo "Running in Docker" else echo "Not running in Docker" fi
Last Updated on August 17, 2024
docker=$(cat /proc/self/cgroup | awk -F/ '$2 == "docker"') if [ ! -z "$docker" ]; then echo "Running in Docker" else echo "Not running in Docker" fi