---
name: docker_container_info
lang: go
domain: infra
version: "1.0.0"
algebraic: product
definition: |
  type DockerContainerInfo struct {
    ID       string
    Names    []string
    Image    string
    State    string
    Status   string
    Ports    []string
    Networks []string
    Labels   map[string]string
  }
description: "Container Docker enriquecido retornado por DockerContainerList. Campos richer que ContainerInfo: Names y Ports como slices, Networks, Labels como map."
tags: [docker, docker-agent, container, infra]
uses_types: []
file_path: "functions/infra/docker_container_list.go"
---

## Ejemplo

```go
c := infra.DockerContainerInfo{
    ID:       "abc123def456",
    Names:    []string{"/my-app"},
    Image:    "nginx:latest",
    State:    "running",
    Status:   "Up 2 hours",
    Ports:    []string{"0.0.0.0:8080->80/tcp"},
    Networks: []string{"bridge"},
    Labels:   map[string]string{"app": "my-app", "env": "prod"},
}
// Mostrar nombre sin slash inicial
fmt.Println(strings.TrimPrefix(c.Names[0], "/"))
```

## Notas

Difiere de `ContainerInfo` (container_info_go_infra) en que `Names` y `Ports` son `[]string` en lugar de `string`, y añade `Networks`. Esto refleja el JSON nativo del Docker Engine API (`/containers/json`) donde estos campos son arrays. Retornado por `docker_container_list_go_infra`.
