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.
17 lines
349 B
Go
17 lines
349 B
Go
package infra
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
"strings"
|
|
)
|
|
|
|
// DockerPullImage descarga una imagen Docker del registry remoto.
|
|
func DockerPullImage(image string) error {
|
|
out, err := exec.Command("docker", "pull", image).CombinedOutput()
|
|
if err != nil {
|
|
return fmt.Errorf("docker pull %s: %s", image, strings.TrimSpace(string(out)))
|
|
}
|
|
return nil
|
|
}
|