Adam K Dean Posted on Apr 5, 2015 Get container ID from within container #docker #shell #linux To get the container ID from within a container, use this: $ cat /proc/self/cgroup | grep "docker" | sed s/\\//\\n/g | tail -1 Enter fullscreen mode Exit fullscreen mode I'll probably stick it in an npm module at some point. Top comments (0) Subscribe Submit Preview Dismiss Code of Conduct • Report abuse
Top comments (0)