feat: main flow created
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package tui
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
func RunContainer(image string, name string, port int) error {
|
||||
|
||||
cmd := exec.Command(
|
||||
"docker", "run",
|
||||
"-d",
|
||||
"--name", name,
|
||||
"-p", fmt.Sprintf("%d:%d", port, port),
|
||||
image,
|
||||
)
|
||||
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func PullImage(image string) (string, error) {
|
||||
|
||||
cmd := exec.Command("docker", "pull", image)
|
||||
|
||||
out, err := cmd.CombinedOutput()
|
||||
return string(out), err
|
||||
}
|
||||
Reference in New Issue
Block a user