{# docker/container_detail.html — full detail page for one container. A swarm task is titled by its service and slot, with the raw container name under it; CPU reads in cores and memory in bytes (see _usage.html). #} {% extends "base.html" %} {% from "_macros.html" import crumbs %} {% from "docker/_usage.html" import cpu, mem %} {% block title %}{{ label or name }} — Docker — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Docker", "/plugins/docker/"), (label or name, "")]) }}{% endblock %} {% block content %} {% if container is none %}
Container not found
No container named {{ name }} is currently reported for this host. It may have been removed, or the host agent hasn't reported recently.
{% else %} {# ── Header ──────────────────────────────────────────────────────────────── #}

{{ label }}

{% if container.health == 'healthy' %}healthy {% elif container.health == 'unhealthy' %}unhealthy {% elif container.health == 'starting' %}starting{% endif %}
{% if label != container.name %}
{{ container.name }}
{% endif %}
{{ container.status }}{% if uptime %} · up {{ uptime }}{% endif %} {% if host %} · on {{ host.name }}{% endif %} · View logs
{# ── Facts grid ──────────────────────────────────────────────────────────── #} {% macro fact(label, value, colour="") %}
{{ label }}
{{ value }}
{% endmacro %}
{{ fact("CPU", cpu(usage) if container.status == 'running' else "—") }} {{ fact("Memory", mem(usage) if container.status == 'running' else "—") }} {#- Swarm never restarts a task's container: it replaces the task with a new one, so restart_count is always 0 there and the service's task failures (Swarm page) are the count that means something. #} {% if not container.service_name %} {{ fact("Restarts", container.restart_count, "var(--orange)" if container.restart_count else "") }} {% endif %} {{ fact("Last exit", (container.exit_code ~ (" (OOM)" if container.oom_killed else "")) if container.exit_code is not none else "—", "var(--red)" if exit_failed else "") }} {{ fact("Net in since start", net_rx) }} {{ fact("Net out since start", net_tx) }} {{ fact("Disk read since start", blk_read) }} {{ fact("Disk written since start", blk_write) }}
{% if container.service_name %}
Swarm replaces a failed task with a new container rather than restarting it; the service's failed tasks are on the Swarm page.
{% endif %} {# ── Image / placement ───────────────────────────────────────────────────── #}
Image {{ container.image or "—" }} {% if container.compose_project %} Compose project{{ container.compose_project }} {% endif %} {% if container.service_name %} Swarm service{{ container.service_name }} {% endif %} {% if container.node_id %} Node {% if node_name %}{{ node_name }} {% else %}{{ container.node_id }}{% endif %} {% endif %} {% if ports %} Ports {% for p in ports %}{{ p.host_port }}:{{ p.container_port }}/{{ p.protocol }}{% if not loop.last %}, {% endif %}{% endfor %} {% endif %}
{# ── Resource history (range-toggled) ────────────────────────────────────── #}

Resource history

{% include "_time_range.html" %}
Loading…
{# ── Lifecycle timeline ──────────────────────────────────────────────────── #}

Lifecycle

{% if events %}
{% for e in events %}
{{ e.glyph }} {{ e.event }} {{ e.detail or "" }} {{ e.at.strftime("%Y-%m-%d %H:%M") }}
{% endfor %}
{% else %}
No lifecycle events recorded yet. Start/stop/health changes appear here as the agent reports them over time.
{% endif %}
{% endif %} {% endblock %}