0402e0fdbe
Funciones Docker: list/start/stop/remove containers, list/pull/remove images, inspect, logs, run. Tipos: ContainerInfo e ImageInfo. Pre-existentes en el dominio infra, ahora registrados.
973 B
973 B
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | tested | tests | test_file_path | file_path | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| docker_list_containers | function | go | infra | 1.0.0 | impure | func DockerListContainers(all bool) ([]ContainerInfo, error) | Lista contenedores Docker locales. Si all es true incluye contenedores detenidos. Parsea la salida JSON de docker ps. |
|
|
|
false | error_go_core |
|
false | functions/infra/docker_list_containers.go |
Ejemplo
containers, err := DockerListContainers(true)
if err != nil {
log.Fatal(err)
}
for _, c := range containers {
fmt.Printf("%s %s %s\n", c.ID, c.Name, c.Status)
}
Notas
Usa docker ps --format '{{json .}}' para parsear la salida de forma confiable. Incluye helpers internos splitLines y parseLabels.