#Is there a Go example somewhere of a

1 messages ยท Page 1 of 1 (latest)

weary nova
queen nexus
#

I suppose a multi-stage build would be one way of doing it. I was thinking, "Container A compiles a binary that containers B, C, and D use in parallel"

#

if I were to do it with just Docker I would probably create a volume, run the container to compile the program, then use that same volume on the other containers.

weary nova
#

Yeah I think the way of accomplishing that should be the same. The

            base.FS().WithFile("/bin/hello",    builder.File("/src/hello")

is the important bit where I grab a file (or directory) from another container and put it in the new one. Depending on what you're doing (i.e. not publishing or saving the container), you could do this with mounts instead and save a few steps too

#

with mounts it would look like

mynewcontainer.WithMountedDirectory("/app", myothercontainer.Directory("/app"))
queen nexus
#

gotya. That's helpful, thank you. I wonder if it'd be possible to make your pipeline skip the "go build -o hello" and just provide the "hello" binary if nothing changed, sort of like how a multi-stage build would behave with docker. ๐Ÿค”

weary nova
#

That's exactly what it'll do ๐Ÿ˜„ But that's handled behind the scenes in the engine

queen nexus
#

ohhhh that's awesome.