Files
fn_registry/functions/infra/docker_compose_down.md
T
egutierrez 90693fb32f feat: funciones infra — Docker, deploy, build y health check
Funciones impuras para gestión de contenedores: docker_build_image,
docker_compose_up/down, docker_volume_create/list/remove,
generate_dockerfile, write_dockerfile, go_build_binary, health_check_http,
deploy_app y stop_app. Todas con tests unitarios donde aplica.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 14:24:12 +02:00

1.1 KiB

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_compose_down function go infra 1.0.0 impure func DockerComposeDown(composeFile string, removeVolumes bool) (string, error) Baja un stack docker-compose desde el archivo dado. Si removeVolumes es true elimina también los volumes declarados (-v). Retorna el stdout del comando.
docker
compose
down
infra
false error_go_core
fmt
os/exec
strings
true
removeVolumes true agrega flag -v al comando
error si composeFile no existe
functions/infra/docker_compose_down_test.go functions/infra/docker_compose_down.go

Ejemplo

// Bajar stack y limpiar volumes
out, err := DockerComposeDown("./docker-compose.yml", true)
if err != nil {
    log.Fatal(err)
}
fmt.Println(out)

Notas

Ejecuta docker compose -f composeFile down [-v]. Usa el subcomando docker compose (V2). El flag -v elimina volumes nombrados declarados en el compose file, no volumes externos. Retorna stdout + stderr combinados.