Skip to content

Instantly share code, notes, and snippets.

@diegoperini
Created November 3, 2020 15:06
Show Gist options
  • Save diegoperini/cc4e5be3bf375d021924639bfcc100b5 to your computer and use it in GitHub Desktop.
Save diegoperini/cc4e5be3bf375d021924639bfcc100b5 to your computer and use it in GitHub Desktop.
Bash command to check if running in a Docker container
(cat /proc/1/cgroup | grep -m 1 docker > /dev/null && echo docker) || echo baremetal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment