How to check if running inside Docker?

Written by Yujin Boby

Edit in WordPress

To check if you are inside a docker container, run the command

cat /proc/1/cgroup | grep --color  docker

If you get some result with docker in it, you are inside a docker container.

Example

identify docker container

See Docker