DEV Community

Cover image for Get container ID from within container
Adam K Dean
Adam K Dean

Posted on

1

Get container ID from within container

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)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more