Skip to content

Instantly share code, notes, and snippets.

@Cadichon
Created November 12, 2020 14:49
Show Gist options
  • Select an option

  • Save Cadichon/6aac5a09cf94c45a640a19b8da7f9097 to your computer and use it in GitHub Desktop.

Select an option

Save Cadichon/6aac5a09cf94c45a640a19b8da7f9097 to your computer and use it in GitHub Desktop.
check if running inside docker container
running_in_docker() {
#shellcheck disable=SC2034
(awk -F/ '$2 == "docker"' /proc/self/cgroup | read -r non_empty_input) > /dev/null 2>&1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment