ahmetb/go-dexec

application is blocking forever

F1zm0n opened this issue · 4 comments

func main() {
	cl, _ := docker.NewClientFromEnv()
	d := dexec.Docker{Client: cl}

	m, _ := dexec.ByCreatingContainer(docker.CreateContainerOptions{
		Config: &docker.Config{Image: "node"}})

	cmd := d.Command(m, "echo", `I am running inside a container!`)
	b, err := cmd.Output()
	if err != nil {
		panic(err)
	}
	fmt.Printf("%s", b)
}

i know its been a long time but when i execute this code my application is blocking forever even tho container is stopped

It probably has something to do with Docker Remote API or the docker daemon. This library is pretty dumb, so highly doubt that's the issue.

It probably has something to do with Docker Remote API or the docker daemon. This library is pretty dumb, so highly doubt that's the issue.

its def something has to do with ByCreatingContainer but anyways appreciate the library

What sort of debugging you've done so far to make you say "its def" this library?

What sort of debugging you've done so far to make you say "its def" this library?

it works good without this method function, i've tried several things, anyways i just had to move to official docker client, to create type of stuff that you created but from scratch, needed it for pipeline executions, because docker client just is very clunky for me, ig i had to stick with it for rn