Skip to content

Instantly share code, notes, and snippets.

View youssefalaoui's full-sized avatar

Youssef youssefalaoui

View GitHub Profile
@pulkitsinghal
pulkitsinghal / README.md
Last active May 13, 2024 09:40
How can a nodejs process running inside a docker container, get that container's id?

Problem

How can a nodejs process running inside a docker container, get that container's id?

Solution

the hostname seems to be the short container id in Docker v1.12

It works and this idea was found in this SO post.