Image with go AND nodejs (IPFS CLUSTER)

Hi there, I’m planning on using balena to manage a swarm of ipsf cluster node that are running on some PI, to do so I would need to use both go and node on the same image,

I did not found in the image list any that would fit my needs, so I started trying to do a post install on a go images to add node js.

It is not working (yet) but I’m making progress, still this is clunky (apt update/upgrade, add node apt source, install) so i was wondering if it was a bad idea, and if there was a cleaner way to do so.

also i could not find info on how i could do this once (add node and all needed deps for IPFS) and make an image out of it, so all changes to the dockerfile don’t imply the whole update system / install node )

thanks for your input and for balena

Hi,

Sounds like a cool project!

I would use multi stage builds. For go you don’t need a runtime, so you build you go application in a build stage using a golang flavored version of our base images to build the binary. As runtime stage you can use a node flavored version of our base images and copy over the go binary to the runtime stage.

Best regards,

1 Like

Thanks for the ideal! I’ll look into that and let you know how it worked.

Have a good day