Adam K Dean

Get container ID from within container

Published on 5 April 2015 at 12:11 by Adam

To get the container ID from within a container, use this:

$ cat /proc/self/cgroup | grep "docker" | sed s/\\//\\n/g | tail -1

I'll probably stick it in an npm module at some point.



This post was first published on 5 April 2015 at 12:11. It was filed under archive with tags docker, shell, linux.