go-dexec icon indicating copy to clipboard operation
go-dexec copied to clipboard

application is blocking forever

Open F1zm0n opened this issue 1 year ago • 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

F1zm0n avatar Jul 29 '24 10:07 F1zm0n

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.

ahmetb avatar Jul 29 '24 16:07 ahmetb

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

F1zm0n avatar Jul 29 '24 16:07 F1zm0n

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

ahmetb avatar Jul 29 '24 19:07 ahmetb

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

F1zm0n avatar Jul 30 '24 02:07 F1zm0n