---
name: docker_create_network
kind: function
lang: go
domain: infra
version: "1.0.0"
purity: impure
signature: "func DockerCreateNetwork(name, driver string) (string, error)"
description: "Crea una red Docker con el nombre y driver dados. Si driver está vacío usa bridge por defecto. Devuelve el ID de la red creada."
tags: [docker, network, create, infra]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_go_core"
imports: [fmt, os/exec, strings]
params:
  - name: name
    desc: "nombre de la red Docker a crear"
  - name: driver
    desc: "driver de la red (bridge, host, overlay, etc. o vacio para bridge por defecto)"
output: "ID de la red Docker creada"
tested: false
tests: []
test_file_path: ""
file_path: "functions/infra/docker_create_network.go"
---

## Ejemplo

```go
netID, err := DockerCreateNetwork("my-app-net", "bridge")
if err != nil {
    log.Fatal(err)
}
fmt.Println("Network ID:", netID)
```
