hashicorp / hashicorp/nomad

[question] Query Container ID

Open
#4,848 4 comments 2 reactions 0 assignees View on GitHub
stage/needs-discussion type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

I'm looking for a way to associate running containers to an alloc id. This is for general debugging, or for example to use tools like https://github.com/google/cadvisor

I experimented with the label solution, where I add this to my HCL:

```
config {
labels = "${NOMAD_ALLOC_ID}"
}
```
Also, the container name seems to contain the alloc id in it, e.g. `${task-name}-${nomad_alloc_id}` in the output of `docker ps`.

I'm sure the ContainerID is kept track of in the code - is there a way to print this information from `nomad alloc-status`? Or `nomad node status`?

Is that useful? e.g. `nomad alloc-status ${alloc-id}` to print the actual container ID (if it's using the Docker driver).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `nomad alloc-status` and `nomad node status` CLI entry points, then trace how the Docker driver’s ContainerID is tracked for an allocation. Done means determining whether that ID can be exposed in the requested status output, with behavior limited to Docker-backed allocations.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.