get-container-id: Get the container/pod ID from inside the container/pod. Supports Docker and K8s.
2.6K
Get a Container ID from inside of itself :)
GitHub repository: https://github.com/ming-go/lab/tree/master/get-container-id
~$ docker pull iwdmb/get-container-id:1.0.7-root
/containerID # Response container's IDHTTP/1.1 200 OK
Content-Type: application/json
{
"data":"629ebc1d8c4a1e95bc32737e6270f08905b441ad6a08c76f4cff4897bb8c6d98"
}
/hello # Response Hello, world!HTTP/1.1 200 OK
Content-Type: application/json
{
"data":"Hello, ming-go!"
}
/counter # A counter, Requests per secondHTTP/1.1 200 OK
Content-Type: application/json
{
"data":"1"
}
/* # Output Request InfoContent type
Image
Digest
Size
6.1 MB
Last updated
over 6 years ago
docker pull iwdmb/get-container-id:1.0.7-root